Skip to content

Commit 511833a

Browse files
AlanSternJames Bottomley
authored andcommitted
SCSI: fix regression in scsi_send_eh_cmnd()
Commit ac61d19 (scsi: set correct completion code in scsi_send_eh_cmnd()) introduced a bug. It changed the stored return value from a queuecommand call, but it didn't take into account that the return value was used again later on. This patch fixes the bug by changing the later usage. There is a big comment in the middle of scsi_send_eh_cmnd() which does a good job of explaining how the routine works. But it mentions a "rtn = FAILURE" value that doesn't exist in the code. This patch adjusts the code to match the comment (I assume the comment is right and the code is wrong). This fixes Bugzilla #88341. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Андрей Аладьев <aladjev.andrew@gmail.com> Tested-by: Андрей Аладьев <aladjev.andrew@gmail.com> Fixes: ac61d19 Acked-by: Hannes Reinecke <hare@suse.de> Cc: <stable@vger.kernel.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
1 parent efc7a28 commit 511833a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/scsi/scsi_error.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
10411041
}
10421042
/* signal not to enter either branch of the if () below */
10431043
timeleft = 0;
1044-
rtn = NEEDS_RETRY;
1044+
rtn = FAILED;
10451045
} else {
10461046
timeleft = wait_for_completion_timeout(&done, timeout);
10471047
rtn = SUCCESS;
@@ -1081,7 +1081,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
10811081
rtn = FAILED;
10821082
break;
10831083
}
1084-
} else if (!rtn) {
1084+
} else if (rtn != FAILED) {
10851085
scsi_abort_eh_cmnd(scmd);
10861086
rtn = FAILED;
10871087
}

0 commit comments

Comments
 (0)