mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
SCSI: Fix error handling when no ULD is attached
Commit 18a4d0a22e ("[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]>
This commit is contained in:
parent
bfecc60d8f
commit
919f797a4c
2 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue