All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Md Haris Iqbal <haris.iqbal@ionos.com>
Cc: linux-rdma@vger.kernel.org, bvanassche@acm.org, leon@kernel.org,
	jinpu.wang@ionos.com
Subject: Re: [PATCH v3 1/2] RDMA/rtrs-clt: Fix possible double free in error case
Date: Wed, 16 Feb 2022 14:04:46 -0400	[thread overview]
Message-ID: <20220216180446.GA1270953@nvidia.com> (raw)
In-Reply-To: <20220209151425.142448-1-haris.iqbal@ionos.com>

On Wed, Feb 09, 2022 at 04:14:24PM +0100, Md Haris Iqbal wrote:
> Callback function rtrs_clt_dev_release() for put_device() calls kfree(clt)
> to free memory. We shouldn't call kfree(clt) again, and we can't use the
> clt after kfree too.
> 
> Replace device_register with device_initialize and device_add so that
> dev_set_name can be used appropriately.
> 
> Move mutex_destroy to release function so it can be called in alloc_clt err
> path.
> 
> Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
> Reviewed-by: Jack Wang <jinpu.wang@ionos.com>
> ---
>  drivers/infiniband/ulp/rtrs/rtrs-clt.c | 37 ++++++++++++++------------
>  1 file changed, 20 insertions(+), 17 deletions(-)

Fixes lines for both patches?

Jason

  parent reply	other threads:[~2022-02-16 18:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 15:14 [PATCH v3 1/2] RDMA/rtrs-clt: Fix possible double free in error case Md Haris Iqbal
2022-02-09 15:14 ` [PATCH 2/2] RDMA/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close Md Haris Iqbal
2022-02-09 18:06   ` Jinpu Wang
2022-02-16 18:04 ` Jason Gunthorpe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-02 15:08 [PATCH v3 1/2] RDMA/rtrs-clt: Fix possible double free in error case Md Haris Iqbal
2022-02-08 16:48 ` Jason Gunthorpe
2022-02-09 11:09   ` Haris Iqbal
2022-02-09 12:00   ` Haris Iqbal
2022-02-09 12:25     ` Jason Gunthorpe

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=20220216180446.GA1270953@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=bvanassche@acm.org \
    --cc=haris.iqbal@ionos.com \
    --cc=jinpu.wang@ionos.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.