From: Jason Gunthorpe <jgg@ziepe.ca>
To: "Håkon Bugge" <haakon.bugge@oracle.com>
Cc: Dinghao Liu <dinghao.liu@zju.edu.cn>,
kjlu@umn.edu, Doug Ledford <dledford@redhat.com>,
Yishai Hadas <yishaih@mellanox.com>,
Leon Romanovsky <leon@kernel.org>,
Michel Lespinasse <walken@google.com>,
Ariel Elior <ariel.elior@marvell.com>,
Michal Kalderon <michal.kalderon@marvell.com>,
OFED mailing list <linux-rdma@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] IB/uverbs: Fix memleak in ib_uverbs_add_one
Date: Fri, 21 Aug 2020 10:39:19 -0300 [thread overview]
Message-ID: <20200821133919.GC24045@ziepe.ca> (raw)
In-Reply-To: <E59593D2-E7F5-4D41-B6DC-B8B8C55241CE@oracle.com>
On Fri, Aug 21, 2020 at 11:47:32AM +0200, Håkon Bugge wrote:
>
>
> > On 21 Aug 2020, at 10:10, Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:
> >
> > When ida_alloc_max() fails, uverbs_dev should be freed
> > just like when init_srcu_struct() fails. It's the same
> > for the error paths after this call.
> >
> > Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> > drivers/infiniband/core/uverbs_main.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
> > index 37794d88b1f3..c6b4e3e2aff6 100644
> > +++ b/drivers/infiniband/core/uverbs_main.c
> > @@ -1170,6 +1170,7 @@ static int ib_uverbs_add_one(struct ib_device *device)
> > ib_uverbs_comp_dev(uverbs_dev);
> > wait_for_completion(&uverbs_dev->comp);
> > put_device(&uverbs_dev->dev);
> > + kfree(uverbs_dev);
>
> Isn't this taken care of by the *release* function pointer, which
> happens to be ib_uverbs_release_dev() ?
Yep
Jason
next prev parent reply other threads:[~2020-08-21 13:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 8:10 [PATCH] IB/uverbs: Fix memleak in ib_uverbs_add_one Dinghao Liu
2020-08-21 9:47 ` Håkon Bugge
2020-08-21 13:39 ` Jason Gunthorpe [this message]
2020-08-22 5:58 ` dinghao.liu
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=20200821133919.GC24045@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=ariel.elior@marvell.com \
--cc=dinghao.liu@zju.edu.cn \
--cc=dledford@redhat.com \
--cc=haakon.bugge@oracle.com \
--cc=kjlu@umn.edu \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=michal.kalderon@marvell.com \
--cc=walken@google.com \
--cc=yishaih@mellanox.com \
/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).