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>
Thu, 4 Oct 2018 00:00:47 +0000 (17:00 -0700)
commite862ab6b69c487fa4df545a60203fef1133bda9f
tree4a9476b78ec382ddbe84671bdfe42aeb36e2716d
parente0ccd2360a474d6505c5a5fa7ea5036a2eecd665
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