diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-13 19:59:15 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-13 19:59:15 -0400 |
commit | 7d72e6fa56c4100b9669efe0044f77ed9eb785a1 (patch) | |
tree | 5e90bf4969809a1ab20b97432b85be20ccfaa1f4 /drivers/scsi/sg.c | |
parent | ba00376b0b13f234d839541a7b36a5bf5c2a4036 (diff) | |
parent | 2be1f3a73dd02e38e181cf5abacb3d45a6a2d6b8 (diff) |
Merge branch 'master' into for-linus
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r-- | drivers/scsi/sg.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 2968c6b83ddb..78d616315d8e 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1686,14 +1686,9 @@ static int sg_start_req(Sg_request *srp, unsigned char *cmd) | |||
1686 | int len, size = sizeof(struct sg_iovec) * iov_count; | 1686 | int len, size = sizeof(struct sg_iovec) * iov_count; |
1687 | struct iovec *iov; | 1687 | struct iovec *iov; |
1688 | 1688 | ||
1689 | iov = kmalloc(size, GFP_ATOMIC); | 1689 | iov = memdup_user(hp->dxferp, size); |
1690 | if (!iov) | 1690 | if (IS_ERR(iov)) |
1691 | return -ENOMEM; | 1691 | return PTR_ERR(iov); |
1692 | |||
1693 | if (copy_from_user(iov, hp->dxferp, size)) { | ||
1694 | kfree(iov); | ||
1695 | return -EFAULT; | ||
1696 | } | ||
1697 | 1692 | ||
1698 | len = iov_length(iov, iov_count); | 1693 | len = iov_length(iov, iov_count); |
1699 | if (hp->dxfer_len < len) { | 1694 | if (hp->dxfer_len < len) { |