Re: [PATCH] net: xfrm: fix bug in ipcomp_free_scratches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 16, 2021 at 3:53 PM Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:
>
> 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.

Yes, you're right. Let me double-check the code and find out where the
problem is.

>
> Cheers,
> --
> Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux