]> git.baikalelectronics.ru Git - kernel.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)
commita48b1cb121be0d71feba27fe269394416482757f
tree885363772f3a1a375911c0ac6c698406fefe68ed
parentc22701de17effe4ba213dc2314be7dcef9054544
IB/hfi1: Fix math bugs in hfi1_can_pin_pages()

[ Upstream commit 9765d6726032a25627a4122f81dea34e369a08ee ]

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: e25d07a42e77 ("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