From b0fbe7b6ddec9e28008b5477fbe8894f696aaa48 Mon Sep 17 00:00:00 2001 From: Matthew Dharm Date: Sun, 12 Oct 2003 05:00:39 -0700 Subject: [PATCH] [PATCH] problems with USB memory pen This fixes a bug which was introduced when the code was switched to use atomic_read()s. The bug prevents hot-unplugging of SCSI (or emulated SCSI) devices from working. From Patrick Mansfield. --- drivers/scsi/scsi_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index b70f007cf2de7..a1bb65b10ab9b 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -412,7 +412,7 @@ void scsi_remove_device(struct scsi_device *sdev) set_bit(SDEV_DEL, &sdev->sdev_state); if (sdev->host->hostt->slave_destroy) sdev->host->hostt->slave_destroy(sdev); - if (atomic_read(&sdev->access_count)) + if (!atomic_read(&sdev->access_count)) device_del(&sdev->sdev_gendev); up_write(&class->subsys.rwsem); } -- 2.53.0