summaryrefslogtreecommitdiff
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-04-20 18:34:20 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2020-04-20 18:34:20 +0300
commitf7ea285b6266822bd63af2a3695f03e3357fd74f (patch)
treead5d6f3bab25094c81a072fb56fcac2f50ed91ed /drivers/scsi/sg.c
parent97e130f63757ede9abc4a9ee42b5fcad466a8e97 (diff)
parentc7582ff7ed388b803d083166514a4c8acd4ef57d (diff)
Merge branch 'ib-pdx86-properties'
Merge branch 'ib-pdx86-properties' of git://git.infradead.org/linux-platform-drivers-x86.git to avoid conflicts in PDx86. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 4e6af592f018..9c0ee192f0f9 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -793,8 +793,10 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
"sg_common_write: scsi opcode=0x%02x, cmd_size=%d\n",
(int) cmnd[0], (int) hp->cmd_len));
- if (hp->dxfer_len >= SZ_256M)
+ if (hp->dxfer_len >= SZ_256M) {
+ sg_remove_request(sfp, srp);
return -EINVAL;
+ }
k = sg_start_req(srp, cmnd);
if (k) {