Re: net: xfrm: Deletion of an unnecessary check before the function call "ipcomp_free_tfms"

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

 




On Wed, 19 Nov 2014, SF Markus Elfring wrote:

> >> The ipcomp_free_tfms() function tests whether its argument is NULL and then
> >> returns immediately. Thus the test around the call is not needed.
> >
> > It doesn't though...
>
> You are right that this function implementation does a bit more before
> returning because of a detected null pointer.
> https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/net/xfrm/xfrm_ipcomp.c?id=394efd19d5fcae936261bd48e5b33b21897aacf8#n247
>
> Can you agree that input parameter validation is also performed there?
> Do you want that I resend my patch with a corrected commit message?

This is completely crazy.  The function performs a side effect on a data
structure.  If the call site doesn't want that done in a certain case,
then it should not be done.

julia
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux