SCSI: Fix error handling when no ULD is attached
[linux-flexiantxendom0-3.2.10.git] / drivers / scsi / scsi_error.c
index 2cfcbff..386f0c5 100644 (file)
@@ -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;