lkml.org 
[lkml]   [2021]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net: xfrm: fix bug in ipcomp_free_scratches
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

\
 
 \ /
  Last update: 2021-08-16 09:54    [W:0.065 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site