summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYonatan Cohen <yonatanc@mellanox.com>2016-09-07 13:04:07 +0200
committerDoug Ledford <dledford@redhat.com>2016-09-16 20:14:08 +0200
commitc1cc72cb6ff95cbe02ed747866576dccab4a5911 (patch)
tree760b7443960d74c7abd8f96758898be23754892e /drivers
parentIB/rxe: Fix race condition between requester and completer (diff)
downloadlinux-c1cc72cb6ff95cbe02ed747866576dccab4a5911.tar.xz
linux-c1cc72cb6ff95cbe02ed747866576dccab4a5911.zip
IB/rxe: Fix kmem_cache leak
Decrement qp reference when handling error path in completer to prevent kmem_cache leak. Fixes: 8700e3e7c485 ("Soft RoCE driver") Signed-off-by: Yonatan Cohen <yonatanc@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_comp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c
index 36f67de44095..1c59ef2c67aa 100644
--- a/drivers/infiniband/sw/rxe/rxe_comp.c
+++ b/drivers/infiniband/sw/rxe/rxe_comp.c
@@ -689,7 +689,14 @@ int rxe_completer(void *arg)
qp->req.need_retry = 1;
rxe_run_task(&qp->req.task, 1);
}
+
+ if (pkt) {
+ rxe_drop_ref(pkt->qp);
+ kfree_skb(skb);
+ }
+
goto exit;
+
} else {
wqe->status = IB_WC_RETRY_EXC_ERR;
state = COMPST_ERROR;
@@ -716,6 +723,12 @@ int rxe_completer(void *arg)
case COMPST_ERROR:
do_complete(qp, wqe);
rxe_qp_error(qp);
+
+ if (pkt) {
+ rxe_drop_ref(pkt->qp);
+ kfree_skb(skb);
+ }
+
goto exit;
}
}