Hannes Reinecke 81b6c99989 scsi: core: check for device state in __scsi_remove_target()
As it turned out device_get() doesn't use kref_get_unless_zero(), so we
will be always getting a device pointer.  Consequently, we need to check
for the device state in __scsi_remove_target() to avoid tripping over
deleted objects.

Fixes: fbce4d97fd43 ("scsi: fixup kernel warning during rmmod()")
Reported-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-12-18 22:34:18 -05:00
..
2017-11-14 16:23:44 -08:00
2017-11-14 16:23:44 -08:00
2017-11-14 16:23:44 -08:00
2017-11-14 16:23:44 -08:00
2017-11-14 16:23:44 -08:00
2017-11-14 16:23:44 -08:00
2017-11-15 13:46:33 -08:00
2017-11-14 16:23:44 -08:00
2017-11-14 16:23:44 -08:00
2017-11-15 13:46:33 -08:00
2017-11-14 16:23:44 -08:00
2017-09-07 12:12:43 -07:00
2017-11-14 16:23:44 -08:00
2017-11-14 16:23:44 -08:00
2017-08-25 17:21:11 -04:00
2017-08-24 22:29:06 -04:00
2017-09-05 08:18:42 -04:00
2017-11-14 16:23:44 -08:00
2017-08-25 17:21:10 -04:00
2017-08-08 11:49:51 -04:00
2017-11-14 16:23:44 -08:00
2017-11-14 16:23:44 -08:00
2017-11-14 16:23:44 -08:00
2017-11-14 16:23:44 -08:00
2017-04-13 13:58:20 -04:00
2017-11-14 16:23:44 -08:00
2017-11-14 16:23:44 -08:00
2017-09-07 12:12:43 -07:00
2017-09-07 12:12:43 -07:00
2017-08-08 11:49:51 -04:00
2017-04-26 18:32:29 -04:00