mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
RDMA/qedr: Fix out of bounds index check in query pkey
[ Upstream commitdbe30dae48] 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:a7efd7773e("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>
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
|
||||
int qedr_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey)
|
||||
{
|
||||
if (index > QEDR_ROCE_PKEY_TABLE_LEN)
|
||||
if (index >= QEDR_ROCE_PKEY_TABLE_LEN)
|
||||
return -EINVAL;
|
||||
|
||||
*pkey = QEDR_ROCE_PKEY_DEFAULT;
|
||||
|
||||
Reference in New Issue
Block a user