From: Aditya Pakki <pakki001@umn.edu>
To: pakki001@umn.edu
Cc: kjlu@umn.edu, wu000273@umn.edu,
Dennis Dalessandro <dennis.dalessandro@intel.com>,
Mike Marciniszyn <mike.marciniszyn@intel.com>,
Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq
Date: Fri, 12 Jun 2020 14:54:26 -0500 [thread overview]
Message-ID: <20200612195426.54133-1-pakki001@umn.edu> (raw)
In case of failure of alloc_ud_wq_attr, the memory allocated by
rvt_alloc_rq() is not freed. The patch fixes this issue by
calling rvt_free_rq().
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
drivers/infiniband/sw/rdmavt/qp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index 511b72809e14..17ea7da73bf9 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -1203,6 +1203,7 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,
qp->s_flags = RVT_S_SIGNAL_REQ_WR;
err = alloc_ud_wq_attr(qp, rdi->dparms.node);
if (err) {
+ rvt_free_rq(&qp->r_rq);
ret = (ERR_PTR(err));
goto bail_driver_priv;
}
--
2.25.1
next reply other threads:[~2020-06-12 19:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-12 19:54 Aditya Pakki [this message]
2020-06-13 17:24 ` [PATCH] RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq Dennis Dalessandro
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=20200612195426.54133-1-pakki001@umn.edu \
--to=pakki001@umn.edu \
--cc=dennis.dalessandro@intel.com \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--cc=kjlu@umn.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mike.marciniszyn@intel.com \
--cc=wu000273@umn.edu \
/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).