]> git.baikalelectronics.ru Git - kernel.git/commit
sg: prevent integer overflow when converting from sectors to bytes
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 2 Jun 2014 13:56:46 +0000 (22:56 +0900)
committerChristoph Hellwig <hch@lst.de>
Thu, 17 Jul 2014 20:07:29 +0000 (22:07 +0200)
commit99a8d4cf069108f84af54259706277e6dcdb974b
tree08a5ee77461f9b1899d43fd5c74aea6527be614e
parent0c32ca13379c597de253f582ba801a3a0d5c226e
sg: prevent integer overflow when converting from sectors to bytes

This prevents integer overflow when converting the request queue's
max_sectors from sectors to bytes.  However, this is a preparation for
extending the data type of max_sectors in struct Scsi_Host and
scsi_host_template.  So, it is impossible to happen this integer
overflow for now, because SCSI low-level drivers can not specify
max_sectors greater than 0xffff due to the data type limitation.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/sg.c