Commit b1889407 authored by Gal Pressman's avatar Gal Pressman Committed by Jason Gunthorpe

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

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>
parent 4959d5da
......@@ -55,7 +55,7 @@
int ocrdma_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey)
{
if (index > 1)
if (index > 0)
return -EINVAL;
*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