From: Herbert Xu <herbert@gondor.apana.org.au>
To: Dongliang Mu <mudongliangabcd@gmail.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
syzbot+b9cfd1cc5d57ee0a09ab@syzkaller.appspotmail.com,
stable@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: xfrm: fix bug in ipcomp_free_scratches
Date: Mon, 16 Aug 2021 15:53:46 +0800 [thread overview]
Message-ID: <20210816075346.GA10906@gondor.apana.org.au> (raw)
In-Reply-To: <20210816073832.199701-1-mudongliangabcd@gmail.com>
On Mon, Aug 16, 2021 at 03:38:29PM +0800, Dongliang Mu wrote:
>
> - for_each_possible_cpu(i)
> - vfree(*per_cpu_ptr(scratches, i));
> + for_each_possible_cpu(i) {
> + void *scratch = *per_cpu_ptr(scratches, i);
> + if (!scratch)
> + vfree(scratch);
> + }
This patch is unnecessary. Please check the implementation of
vfree, it already checks for NULL pointers just like most of our
free primitives.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2021-08-16 7:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-16 7:38 [PATCH] net: xfrm: fix bug in ipcomp_free_scratches Dongliang Mu
2021-08-16 7:53 ` Herbert Xu [this message]
2021-08-16 9:35 ` Dongliang Mu
2021-08-16 11:36 ` Dongliang Mu
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=20210816075346.GA10906@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mudongliangabcd@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
--cc=syzbot+b9cfd1cc5d57ee0a09ab@syzkaller.appspotmail.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).