scsi: sg: off by one in sg_ioctl()
authorDan Carpenter <[email protected]>
Thu, 17 Aug 2017 07:09:54 +0000 (10:09 +0300)
committerMartin K. Petersen <[email protected]>
Wed, 23 Aug 2017 02:23:42 +0000 (22:23 -0400)
commitbd46fc406b30d1db1aff8dabaff8d18bb423fdcf
tree7279fb6cd3b1b6641550ad20e7f24152b50a9a7e
parent723cd772fde2344a9810eeaf5106787d535ec4a4
scsi: sg: off by one in sg_ioctl()

If "val" is SG_MAX_QUEUE then we are one element beyond the end of the
"rinfo" array so the > should be >=.

Fixes: 109bade9c625 ("scsi: sg: use standard lists for sg_requests")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Douglas Gilbert <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
drivers/scsi/sg.c