From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: [PATCH rdma-rc V1 4/4] IB/rxe: Fix kmem_cache leak
Date: Wed, 7 Sep 2016 14:04:07 +0300 [thread overview]
Message-ID: <1473246247-16536-5-git-send-email-leon@kernel.org> (raw)
In-Reply-To: <1473246247-16536-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
From: Yonatan Cohen <yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
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-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
drivers/infiniband/sw/rxe/rxe_comp.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c
index 36f67de..1c59ef2 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;
}
}
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-09-07 11:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-07 11:04 [PATCH rdma-rc V1 0/4] RXE fixes for 4.8 Leon Romanovsky
[not found] ` <1473246247-16536-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-09-07 11:04 ` [PATCH rdma-rc V1 1/4] IB/rxe: Fix kernel panic in udp_setup_tunnel Leon Romanovsky
[not found] ` <1473246247-16536-2-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-09-07 11:20 ` Or Gerlitz
[not found] ` <CAJ3xEMhskkpCprziZUZQJWUVvwc_3_MSbJco_bOyuSrwDYXFwQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-07 11:39 ` Moni Shoua
[not found] ` <DB6PR0501MB2037ABAB81A844F098D30738D3F80-wTfl6qNNZ1M0/zJZXFVcNsDSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2016-09-07 13:23 ` Or Gerlitz
2016-09-07 12:13 ` Leon Romanovsky
[not found] ` <20160907121303.GD18398-2ukJVAZIZ/Y@public.gmane.org>
2016-09-07 13:19 ` Or Gerlitz
[not found] ` <CAJ3xEMguukA63m0T9VnXxXkWcmEfRsJeuoDn1NG7RDjm9kZL_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-07 16:02 ` Doug Ledford
2016-09-07 14:18 ` Moni Shoua
2016-09-07 11:04 ` [PATCH rdma-rc V1 2/4] IB/rxe: Fix duplicate atomic request handling Leon Romanovsky
[not found] ` <1473246247-16536-3-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-09-07 11:16 ` Or Gerlitz
2016-09-07 11:04 ` [PATCH rdma-rc V1 3/4] IB/rxe: Fix race condition between requester and completer Leon Romanovsky
[not found] ` <1473246247-16536-4-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-09-07 11:18 ` Or Gerlitz
2016-09-07 11:04 ` Leon Romanovsky [this message]
[not found] ` <1473246247-16536-5-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-09-07 11:13 ` [PATCH rdma-rc V1 4/4] IB/rxe: Fix kmem_cache leak Or Gerlitz
2016-09-16 18:31 ` [PATCH rdma-rc V1 0/4] RXE fixes for 4.8 Doug Ledford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1473246247-16536-5-git-send-email-leon@kernel.org \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=yonatanc-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).