]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Oct 2018 23:59:06 +0000 (16:59 -0700)
commit5ae7031fea6aca491cdc15dd28b2b93f8c7c4b11
tree426ba21c9cf2658e111ad9f4b61eeeb521dd97f1
parentbe853349a4a9784eac564fec0467ad68595e617f
RDMA/bnxt_re: Fix a couple off by one bugs

[ 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>
drivers/infiniband/hw/bnxt_re/qplib_sp.c