RDMA/qedr: Fix out of bounds index check in query pkey
authorGal Pressman <galpress@amazon.com>
Mon, 7 Jan 2019 15:27:56 +0000 (17:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jan 2020 09:24:11 +0000 (10:24 +0100)
commit887ea46f5d3687cc0cb9c2db5a3bad95f7ff6241
treee75a564945a22cbfd78a0ae394168e12406cb6d7
parent5199e5e503140feb433ec175bd4b5a4020737c63
RDMA/qedr: Fix out of bounds index check in query pkey

[ Upstream commit dbe30dae487e1a232158c24b432d45281c2805b7 ]

The pkey table size is QEDR_ROCE_PKEY_TABLE_LEN, index should be tested
for >= QEDR_ROCE_PKEY_TABLE_LEN instead of > QEDR_ROCE_PKEY_TABLE_LEN.

Fixes: a7efd7773e31 ("qedr: Add support for PD,PKEY and CQ verbs")
Signed-off-by: Gal Pressman <galpress@amazon.com>
Acked-by: Michal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/qedr/verbs.c