提交 c1cc72cb 编写于 作者: Y Yonatan Cohen 提交者: Doug Ledford

IB/rxe: Fix kmem_cache leak

Decrement qp reference when handling error path
in completer to prevent kmem_cache leak.

Fixes: 8700e3e7 ("Soft RoCE driver")
Signed-off-by: NYonatan Cohen <yonatanc@mellanox.com>
Signed-off-by: NLeon Romanovsky <leon@kernel.org>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 3050b998
...@@ -689,7 +689,14 @@ int rxe_completer(void *arg) ...@@ -689,7 +689,14 @@ int rxe_completer(void *arg)
qp->req.need_retry = 1; qp->req.need_retry = 1;
rxe_run_task(&qp->req.task, 1); rxe_run_task(&qp->req.task, 1);
} }
if (pkt) {
rxe_drop_ref(pkt->qp);
kfree_skb(skb);
}
goto exit; goto exit;
} else { } else {
wqe->status = IB_WC_RETRY_EXC_ERR; wqe->status = IB_WC_RETRY_EXC_ERR;
state = COMPST_ERROR; state = COMPST_ERROR;
...@@ -716,6 +723,12 @@ int rxe_completer(void *arg) ...@@ -716,6 +723,12 @@ int rxe_completer(void *arg)
case COMPST_ERROR: case COMPST_ERROR:
do_complete(qp, wqe); do_complete(qp, wqe);
rxe_qp_error(qp); rxe_qp_error(qp);
if (pkt) {
rxe_drop_ref(pkt->qp);
kfree_skb(skb);
}
goto exit; goto exit;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册