From: Dennis Dalessandro <dennis.dalessandro@intel.com>
To: Navid Emamdoost <navid.emamdoost@gmail.com>
Cc: emamd001@umn.edu, kjlu@umn.edu, smccaman@umn.edu,
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: Re: [PATCH] IB/hfi1: prevent memory leak in sdma_init
Date: Thu, 26 Sep 2019 07:49:03 -0400 [thread overview]
Message-ID: <84ce2808-4447-cc13-1756-60617336fa1d@intel.com> (raw)
In-Reply-To: <20190925144543.10141-1-navid.emamdoost@gmail.com>
On 9/25/2019 10:45 AM, Navid Emamdoost wrote:
> In sdma_init if rhashtable_init fails the allocated memory for
> tmp_sdma_rht should be released.
>
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> ---
> drivers/infiniband/hw/hfi1/sdma.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c
> index 2395fd4233a7..2ed7bfd5feea 100644
> --- a/drivers/infiniband/hw/hfi1/sdma.c
> +++ b/drivers/infiniband/hw/hfi1/sdma.c
> @@ -1526,8 +1526,11 @@ int sdma_init(struct hfi1_devdata *dd, u8 port)
> }
>
> ret = rhashtable_init(tmp_sdma_rht, &sdma_rht_params);
> - if (ret < 0)
> + if (ret < 0) {
> + kfree(tmp_sdma_rht);
> goto bail;
> + }
> +
> dd->sdma_rht = tmp_sdma_rht;
>
> dd_dev_info(dd, "SDMA num_sdma: %u\n", dd->num_sdma);
>
Yeah looks like a problem to me, thanks.
Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
prev parent reply other threads:[~2019-09-26 11:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 14:45 Navid Emamdoost
2019-09-26 11:49 ` Dennis Dalessandro [this message]
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=84ce2808-4447-cc13-1756-60617336fa1d@intel.com \
--to=dennis.dalessandro@intel.com \
--cc=dledford@redhat.com \
--cc=emamd001@umn.edu \
--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=navid.emamdoost@gmail.com \
--cc=smccaman@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
all inboxes | Powered by JetHome®