All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Navid Emamdoost <navid.emamdoost@gmail.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	Navid Emamdoost <emamd001@umn.edu>,
	Stephen McCamant <smccaman@umn.edu>, Kangjie Lu <kjlu@umn.edu>,
	Potnuri Bharat Teja <bharat@chelsio.com>,
	Doug Ledford <dledford@redhat.com>,
	linux-rdma@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] RDMA: release allocated skb
Date: Thu, 3 Oct 2019 11:20:48 +0300	[thread overview]
Message-ID: <20191003082048.GK5855@unreal> (raw)
In-Reply-To: <CAEkB2EQF0D-Fdg74+E4VdxipZvTaBKseCtKJKnFg7T6ZZE9x6Q@mail.gmail.com>

On Wed, Oct 02, 2019 at 04:35:06PM -0500, Navid Emamdoost wrote:
> Hi Jason,
>
> Thanks for the feedback. Yes, you are right if the skb release is
> moved under err4 label it will cause a double free as
> c4iw_ref_send_wait will release skb in case of error.
> So, in order to avoid leaking skb in case of c4iw_bar2_addrs failure,
> the kfree(skb) could be placed under the error check like the way
> patch v1 did. Do you see any mistake in version 1?
> https://lore.kernel.org/patchwork/patch/1128510/

No, it is not enough.
c4iw_ref_send_wait() ->
  c4iw_wait_for_reply() ->
    return wr_waitp->ret; <--- can be -EIO

Thanks

  reply	other threads:[~2019-10-03  8:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190923050823.GL14368@unreal>
2019-09-23 15:52 ` [PATCH v2] RDMA: release allocated skb Navid Emamdoost
2019-10-01 13:54   ` Jason Gunthorpe
2019-10-02 21:35     ` Navid Emamdoost
2019-10-03  8:20       ` Leon Romanovsky [this message]
2019-10-03 10:25       ` Potnuri Bharat Teja
2019-10-04 18:12         ` Navid Emamdoost

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=20191003082048.GK5855@unreal \
    --to=leon@kernel.org \
    --cc=bharat@chelsio.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=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 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.