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_rdac.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index 5efc959..2a43985 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -531,6 +531,7 @@ static void send_mode_select(struct work_struct *work) struct scsi_device *sdev = ctlr->ms_sdev; struct rdac_dh_data *h = sdev->handler_data; int err = SCSI_DH_OK, retry_cnt = RDAC_RETRY_COUNT; + int result; struct rdac_queue_data *tmp, *qdata; LIST_HEAD(list); unsigned char cdb[MAX_COMMAND_SIZE]; @@ -555,9 +556,10 @@ static void send_mode_select(struct work_struct *work) (char *) h->ctlr->array_name, h->ctlr->index, (retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying"); - if (scsi_execute(sdev, cdb, DMA_TO_DEVICE, &h->ctlr->mode_select, - data_size, NULL, &sshdr, RDAC_TIMEOUT * HZ, - RDAC_RETRIES, req_flags, 0, NULL)) { + result = scsi_execute(sdev, cdb, DMA_TO_DEVICE, &h->ctlr->mode_select, + data_size, NULL, &sshdr, RDAC_TIMEOUT * HZ, + RDAC_RETRIES, req_flags, 0, NULL); + if (driver_byte(result) == DRIVER_SENSE) { err = mode_select_handle_sense(sdev, &sshdr); if (err == SCSI_DH_RETRY && retry_cnt--) goto retry; -- 2.7.4