Commit f2f7875b authored by Gal Pressman's avatar Gal Pressman Committed by Kleber Sacilotto de Souza

RDMA/ocrdma: Fix out of bounds index check in query pkey

BugLink: https://bugs.launchpad.net/bugs/1864773

[ Upstream commit b1889407 ]

The pkey table size is one element, index should be tested for > 0 instead
of > 1.

Fixes: fe2caefc ("RDMA/ocrdma: Add driver for Emulex OneConnect IBoE RDMA adapter")
Signed-off-by: default avatarGal Pressman <galpress@amazon.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 1ac0991f
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
int ocrdma_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey) int ocrdma_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey)
{ {
if (index > 1) if (index > 0)
return -EINVAL; return -EINVAL;
*pkey = 0xffff; *pkey = 0xffff;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment