diff options
-rw-r--r-- | drivers/scsi/sg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index d383f84869aa..b5a4db883223 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1744,6 +1744,9 @@ sg_start_req(Sg_request *srp, unsigned char *cmd) | |||
1744 | md->from_user = 0; | 1744 | md->from_user = 0; |
1745 | } | 1745 | } |
1746 | 1746 | ||
1747 | if (unlikely(iov_count > MAX_UIOVEC)) | ||
1748 | return -EINVAL; | ||
1749 | |||
1747 | if (iov_count) { | 1750 | if (iov_count) { |
1748 | int size = sizeof(struct iovec) * iov_count; | 1751 | int size = sizeof(struct iovec) * iov_count; |
1749 | struct iovec *iov; | 1752 | struct iovec *iov; |