mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
RDMA/ocrdma: Fix off by one in ocrdma_query_gid()
The dev->sgid_tbl[] array is allocated in ocrdma_alloc_resources(). It has OCRDMA_MAX_SGID elements so the test here is off by one. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
This commit is contained in:
parent
a3698a9b91
commit
7b33dc2b05
1 changed files with 1 additions and 1 deletions
|
@ -53,7 +53,7 @@ int ocrdma_query_gid(struct ib_device *ibdev, u8 port,
|
|||
|
||||
dev = get_ocrdma_dev(ibdev);
|
||||
memset(sgid, 0, sizeof(*sgid));
|
||||
if (index > OCRDMA_MAX_SGID)
|
||||
if (index >= OCRDMA_MAX_SGID)
|
||||
return -EINVAL;
|
||||
|
||||
memcpy(sgid, &dev->sgid_tbl[index], sizeof(*sgid));
|
||||
|
|
Loading…
Reference in a new issue