From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Date: Wed, 19 Nov 2014 09:58:01 +0000 Subject: Re: net: xfrm: Deletion of an unnecessary check before the function call "ipcomp_free_tfms" Message-Id: List-Id: References: <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <546BAFF5.5020603@users.sourceforge.net> <20141119084542.GK4905@mwanda> <546C6823.50900@users.sourceforge.net> In-Reply-To: <546C6823.50900@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: SF Markus Elfring Cc: Dan Carpenter , "David S. Miller" , Herbert Xu , Steffen Klassert , netdev@vger.kernel.org, LKML , kernel-janitors@vger.kernel.org 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?id94efd19d5fcae936261bd48e5b33b21897aacf8#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