diff options
| author | Martin K. Petersen <[email protected]> | 2012-04-15 03:01:28 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2012-04-15 18:08:53 +0000 |
| commit | 919f797a4c9c22ff5ec059744dba364dc600ece2 (patch) | |
| tree | 6f2183e84c2bcfdc6eebed82319a4a21b871bdea /drivers/scsi/scsi_error.c | |
| parent | Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/ke... (diff) | |
| download | kernel-919f797a4c9c22ff5ec059744dba364dc600ece2.tar.gz kernel-919f797a4c9c22ff5ec059744dba364dc600ece2.zip | |
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 <[email protected]>
Reported-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
| -rw-r--r-- | drivers/scsi/scsi_error.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 2cfcbffa41fd..386f0c53bea7 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -835,7 +835,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, scsi_eh_restore_cmnd(scmd, &ses); - if (sdrv->eh_action) + if (sdrv && sdrv->eh_action) rtn = sdrv->eh_action(scmd, cmnd, cmnd_size, rtn); return rtn; |
