OSDN Git Service

RDMA/bnxt_re: Fix a bunch of off by one bugs in qplib_fp.c
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 4 Jul 2018 09:58:02 +0000 (12:58 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 4 Jul 2018 18:06:26 +0000 (12:06 -0600)
commitc1dfc0114c901b4f46c85ceff0491debf2b2a2ec
tree427a3e3635c02e542e86e253593503c8843fd930
parent474e5a86067e5f12c97d1db8b170c7f45b53097a
RDMA/bnxt_re: Fix a bunch of off by one bugs in qplib_fp.c

The srq->swq[] is allocated in bnxt_qplib_create_srq().  It has
srq->hwq.max_elements elements so these tests should be > instead of >=
or we might go 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>
drivers/infiniband/hw/bnxt_re/qplib_fp.c