SCSI: Fix error handling when no ULD is attached
authorMartin K. Petersen <martin.petersen@oracle.com>
Sun, 15 Apr 2012 03:01:28 +0000 (23:01 -0400)
committerVarun Wadekar <vwadekar@nvidia.com>
Wed, 18 Apr 2012 15:05:18 +0000 (20:05 +0530)
commit799711de47c5bd9574e290fa8be4bf9865e413d8
treec4b56b465abb1d570ecb756fca2c4dbe6a6741b1
parentc48acfe9a06d0f7748522af2a28177439bdb7744
SCSI: Fix error handling when no ULD is attached

Commit 18a4d0a22ed6 ("[SCSI] Handle disk devices which can not process
medium access commands") introduced a bug in which we would attempt to
dereference the scsi driver even when the device had no ULD attached.

Ensure that a driver is registered and make the driver accessor function
more resilient to errors during device discovery.

Reported-by: Elric Fu <elricfu1@gmail.com>
Reported-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/scsi/scsi_error.c
include/scsi/scsi_cmnd.h