]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
RDMA/bnxt_re: Fix the qp table indexing
authorSelvin Xavier <selvin.xavier@broadcom.com>
Mon, 24 Aug 2020 18:14:33 +0000 (11:14 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 27 Aug 2020 12:30:43 +0000 (09:30 -0300)
commit84cf229f4001c1216afc3e4c7f05e1620a0dd4bc
tree5952f9ba5857a96c60311908a493dacc9b2b5893
parent2d0e60ee322d512fa6bc62d23a6760b39a380847
RDMA/bnxt_re: Fix the qp table indexing

qp->id can be a value outside the max number of qp. Indexing the qp table
with the id can cause out of bounds crash. So changing the qp table
indexing by (qp->id % max_qp -1).

Allocating one extra entry for QP1. Some adapters create one more than the
max_qp requested to accommodate QP1.  If the qp->id is 1, store the
inforamtion in the last entry of the qp table.

Fixes: f218d67ef004 ("RDMA/bnxt_re: Allow posting when QPs are in error")
Link: https://lore.kernel.org/r/1598292876-26529-4-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/bnxt_re/qplib_fp.c
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
drivers/infiniband/hw/bnxt_re/qplib_rcfw.h