]> www.infradead.org Git - users/jedix/linux-maple.git/commit
IB/hfi1: Fix math bugs in hfi1_can_pin_pages()
authorPatrick Kelsey <pat.kelsey@cornelisnetworks.com>
Thu, 16 Feb 2023 16:56:23 +0000 (11:56 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:40 +0000 (09:33 +0100)
commitdb5f82e3a78bc98af3360fc88e6d25d79a60205f
tree885363772f3a1a375911c0ac6c698406fefe68ed
parentb7967f175e798b753e5eb92d261562a6ad7f914c
IB/hfi1: Fix math bugs in hfi1_can_pin_pages()

[ Upstream commit a0d198f79a8d033bd46605b779859193649f1f99 ]

Fix arithmetic and logic errors in hfi1_can_pin_pages() that  would allow
hfi1 to attempt pinning pages in cases where it should not because of
resource limits or lack of required capability.

Fixes: 2c97ce4f3c29 ("IB/hfi1: Add pin query function")
Link: https://lore.kernel.org/r/167656658362.2223096.10954762619837718026.stgit@awfm-02.cornelisnetworks.com
Signed-off-by: Brendan Cunningham <bcunningham@cornelisnetworks.com>
Signed-off-by: Patrick Kelsey <pat.kelsey@cornelisnetworks.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hfi1/user_pages.c