Like sd_pr_command, before use sshdr, we need to check the result of scsi_execute. Signed-off-by: zhengbin <zhengbin13@xxxxxxxxxx> --- drivers/scsi/device_handler/scsi_dh_emc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c index caa685c..cf49378 100644 --- a/drivers/scsi/device_handler/scsi_dh_emc.c +++ b/drivers/scsi/device_handler/scsi_dh_emc.c @@ -267,7 +267,8 @@ static int send_trespass_cmd(struct scsi_device *sdev, &sshdr, CLARIION_TIMEOUT * HZ, CLARIION_RETRIES, req_flags, 0, NULL); if (err) { - if (scsi_sense_valid(&sshdr)) + if (driver_byte(err) == DRIVER_SENSE && + scsi_sense_valid(&sshdr)) res = trespass_endio(sdev, &sshdr); else { sdev_printk(KERN_INFO, sdev, -- 2.7.4