]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
RDMA/bnxt_re: Fix a couple off by one bugs
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 4 Jul 2018 09:57:11 +0000 (12:57 +0300)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:50:41 +0000 (19:50 -0600)
commit0c24aceb8f7bb6540f8285e2c23f54224c5ec6e4
tree56ce0a0966fbd1722de3d6ff594a4c6367b3d5f2
parent7ed347ef15c0f33ef0eea0cf87cb0382837351eb
RDMA/bnxt_re: Fix a couple off by one bugs

BugLink: https://bugs.launchpad.net/bugs/1836287
[ Upstream commit 474e5a86067e5f12c97d1db8b170c7f45b53097a ]

The sgid_tbl->tbl[] array is allocated in bnxt_qplib_alloc_sgid_tbl().
It has sgid_tbl->max elements.  So the > should be >= to prevent
accessing one element beyond the end of the array.

Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/infiniband/hw/bnxt_re/qplib_sp.c