aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroulijun <oulijun@huawei.com>2018-05-04 10:57:13 +0800
committerDoug Ledford <dledford@redhat.com>2018-05-09 10:45:18 -0400
commita0403be8af338c319b5176c1d2975d94a930a0bf (patch)
treecd8b916021c7b2d121fa3d48d72455a4604029a1
parentRDMA/hns: Set NULL for __internal_mr (diff)
downloadlinux-dev-a0403be8af338c319b5176c1d2975d94a930a0bf.tar.xz
linux-dev-a0403be8af338c319b5176c1d2975d94a930a0bf.zip
RDMA/hns: Fix the bug with NULL pointer
When the last QP of eight QPs is not exist in hns_roce_v1_mr_free_work_fn function, the print for qpn of hr_qp may introduce a calltrace for NULL pointer. Signed-off-by: Lijun Ou <oulijun@huawei.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_hw_v1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index b3417a9a49de..8013d69c5ac4 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -1037,7 +1037,7 @@ static void hns_roce_v1_mr_free_work_fn(struct work_struct *work)
do {
ret = hns_roce_v1_poll_cq(&mr_free_cq->ib_cq, ne, wc);
- if (ret < 0) {
+ if (ret < 0 && hr_qp) {
dev_err(dev,
"(qp:0x%lx) starts, Poll cqe failed(%d) for mr 0x%x free! Remain %d cqe\n",
hr_qp->qpn, ret, hr_mr->key, ne);