From: "Håkon Bugge" <haakon.bugge@oracle.com>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>
Cc: kjlu@umn.edu, Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
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 11:47:32 +0200 [thread overview]
Message-ID: <E59593D2-E7F5-4D41-B6DC-B8B8C55241CE@oracle.com> (raw)
In-Reply-To: <20200821081013.4762-1-dinghao.liu@zju.edu.cn>
> 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
> --- a/drivers/infiniband/core/uverbs_main.c
> +++ 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() ?
Thxs, Håkon
> return ret;
> }
>
> --
> 2.17.1
>
next prev parent reply other threads:[~2020-08-21 9:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 8:10 Dinghao Liu
2020-08-21 9:47 ` Håkon Bugge [this message]
2020-08-21 13:39 ` Jason Gunthorpe
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=E59593D2-E7F5-4D41-B6DC-B8B8C55241CE@oracle.com \
--to=haakon.bugge@oracle.com \
--cc=ariel.elior@marvell.com \
--cc=dinghao.liu@zju.edu.cn \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--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
all inboxes | Powered by JetHome®