linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Chengfeng Ye <cyeaa@connect.ust.hk>
Cc: krzysztof.kozlowski@canonical.com, davem@davemloft.net,
	kuba@kernel.org, wengjianfeng@yulong.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] nfc: pn533: Fix double free when pn533_fill_fragment_skbs() fails
Date: Fri, 5 Nov 2021 17:33:55 +0300	[thread overview]
Message-ID: <20211105143355.GC2026@kadam> (raw)
In-Reply-To: <20211105133636.31282-1-cyeaa@connect.ust.hk>

On Fri, Nov 05, 2021 at 06:36:36AM -0700, Chengfeng Ye wrote:
> skb is already freed by dev_kfree_skb in pn533_fill_fragment_skbs,
> but follow error handler branch when pn533_fill_fragment_skbs()
> fails, skb is freed again, results in double free issue. Fix this
> by not free skb in error path of pn533_fill_fragment_skbs.
> 
> Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>

I sort of wish the commit message talked more about the how this changes
the failure return from 0 to -ENOMEM.  But the patch is good.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

regards,
dan carpenter


  reply	other threads:[~2021-11-05 14:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05 13:36 [PATCH v2] nfc: pn533: Fix double free when pn533_fill_fragment_skbs() fails Chengfeng Ye
2021-11-05 14:33 ` Dan Carpenter [this message]
2021-11-06  9:42 ` Krzysztof Kozlowski
2021-11-07 19:40 ` patchwork-bot+netdevbpf

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=20211105143355.GC2026@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=cyeaa@connect.ust.hk \
    --cc=davem@davemloft.net \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wengjianfeng@yulong.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).