]> git.hungrycats.org Git - linux/commitdiff
[PATCH] problems with USB memory pen
authorMatthew Dharm <mdharm@one-eyed-alien.net>
Sun, 12 Oct 2003 12:00:39 +0000 (05:00 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sun, 12 Oct 2003 12:00:39 +0000 (05:00 -0700)
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

index b70f007cf2de7007c58cacb9c9dd72f6e894ef35..a1bb65b10ab9b94525782910b91bf64a01862d33 100644 (file)
@@ -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);
        }