summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelvin Xavier <selvin.xavier@broadcom.com>2018-10-08 13:27:56 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-13 22:08:33 +0300
commit0b27b2b27995bcd7b28db3c0697cb0437c812c2a (patch)
tree70dce54ac3feb5ac231992d5b7b2cf71bda8b774
parentebd7595dcabf48e9255ca080f7c31a3cbc079010 (diff)
downloadlinux-0b27b2b27995bcd7b28db3c0697cb0437c812c2a.tar.xz
RDMA/bnxt_re: Avoid accessing nq->bar_reg_iomem in failure case
[ Upstream commit ed51efd2ce44091a858ad829f666727e7c95695e ] In the failure path, nq->bar_reg_iomem gets accessed without initializing. Avoid this by calling the bnxt_qplib_nq_stop_irq only if the initialization is complete. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Fixes: 6e04b1035689 ("RDMA/bnxt_re: Fix broken RoCE driver due to recent L2 driver changes") Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/infiniband/hw/bnxt_re/qplib_fp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
index 6ad0d46ab879..249efa0a6aba 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
@@ -360,7 +360,8 @@ void bnxt_qplib_disable_nq(struct bnxt_qplib_nq *nq)
}
/* Make sure the HW is stopped! */
- bnxt_qplib_nq_stop_irq(nq, true);
+ if (nq->requested)
+ bnxt_qplib_nq_stop_irq(nq, true);
if (nq->bar_reg_iomem)
iounmap(nq->bar_reg_iomem);