IB/core: Avoid unsigned int overflow in sg_alloc_table
authorMark Bloch <markb@mellanox.com>
Thu, 27 Oct 2016 13:36:31 +0000 (16:36 +0300)
committerDoug Ledford <dledford@redhat.com>
Thu, 17 Nov 2016 01:03:44 +0000 (20:03 -0500)
commit3c7ba5760ab8eedec01159b267bb9bfcffe522ac
tree36e6c1ab64e36f899718b69ce3b6b989c2c13bf1
parent61c3702863be9e9f1ef12ed5a5b17bae6cdfac0b
IB/core: Avoid unsigned int overflow in sg_alloc_table

sg_alloc_table gets unsigned int as parameter while the driver
returns it as size_t. Check npages isn't greater than maximum
unsigned int.

Fixes: eeb8461e36c9 ("IB: Refactor umem to use linear SG table")
Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/umem.c