aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-04-24 16:31:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-04-24 16:31:08 -0400
commit8f9cedc76fc7d9bc916127f8fe1287a249891d40 (patch)
tree9766c7391cb20e08b28299f5aef9e35051c7d82d
parent3d339d3370417b627011ac2a98525ca4dec325ae (diff)
parentca855a5e2679e9e571dfb0e64f4484b36f1992a8 (diff)
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fix from James Bottomley: "Our final fix before the 4.12 release (hopefully). It's an error leg again: the fix to not bug on empty DMA transfers is returning the wrong code and confusing the block layer" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: return correct blkprep status code in case scsi_init_io() fails.
-rw-r--r--drivers/scsi/scsi_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index e5a2d590a104..15c9fe766071 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1061,10 +1061,10 @@ int scsi_init_io(struct scsi_cmnd *cmd)
1061 struct scsi_device *sdev = cmd->device; 1061 struct scsi_device *sdev = cmd->device;
1062 struct request *rq = cmd->request; 1062 struct request *rq = cmd->request;
1063 bool is_mq = (rq->mq_ctx != NULL); 1063 bool is_mq = (rq->mq_ctx != NULL);
1064 int error; 1064 int error = BLKPREP_KILL;
1065 1065
1066 if (WARN_ON_ONCE(!blk_rq_nr_phys_segments(rq))) 1066 if (WARN_ON_ONCE(!blk_rq_nr_phys_segments(rq)))
1067 return -EINVAL; 1067 goto err_exit;
1068 1068
1069 error = scsi_init_sgtable(rq, &cmd->sdb); 1069 error = scsi_init_sgtable(rq, &cmd->sdb);
1070 if (error) 1070 if (error)