diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-02-24 12:03:21 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-02-24 12:03:21 +0800 |
commit | ba0cfa06c512552bdba8264b46b006478253f39b (patch) | |
tree | 803ecd2eddc27a45fe41691a2ac058f59051fe9d /drivers/scsi/sg.c | |
parent | 26c815656d14b133b04936f384f5a55fceb2e835 (diff) | |
parent | aedb4a24b9ae4fbd6ced45ae64ae3d84b423f5c2 (diff) |
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index a1c29b0afb22..dedcff9cabb5 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1763,6 +1763,10 @@ sg_start_req(Sg_request *srp, unsigned char *cmd) return res; iov_iter_truncate(&i, hp->dxfer_len); + if (!iov_iter_count(&i)) { + kfree(iov); + return -EINVAL; + } res = blk_rq_map_user_iov(q, rq, md, &i, GFP_ATOMIC); kfree(iov); |