Re: net: xfrm: Deletion of an unnecessary check before the function call "ipcomp_free_tfms"
From: Dan Carpenter Date: Wed, 19 Nov 2014 13:10:03 +0300 > I have come to view you as a very clever troll. +1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: net: xfrm: Deletion of an unnecessary check before the function call "ipcomp_free_tfms"
I have come to view you as a very clever troll. You will say infuriating things like "That is an interesting background information but the function implementation update suggestion is correct" and pretend to not see the bug for nine emails. Then you'll say something "Ha ha, I audited all the call trees and it can't actually be NULL so you were getting angry for no reason." Except you'll say it in a more obfuscated way than that. This is what you did last time. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: net: xfrm: Deletion of an unnecessary check before the function call "ipcomp_free_tfms"
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 linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: net: xfrm: Deletion of an unnecessary check before the function call "ipcomp_free_tfms"
>> 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? Regards, Markus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/1] net: xfrm: Deletion of an unnecessary check before the function call "ipcomp_free_tfms"
On Tue, Nov 18, 2014 at 09:45:41PM +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 18 Nov 2014 21:41:26 +0100 > > 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... regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/1] net: xfrm: Deletion of an unnecessary check before the function call ipcomp_free_tfms
On Tue, Nov 18, 2014 at 09:45:41PM +0100, SF Markus Elfring wrote: From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 18 Nov 2014 21:41:26 +0100 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... regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: net: xfrm: Deletion of an unnecessary check before the function call ipcomp_free_tfms
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? Regards, Markus -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: net: xfrm: Deletion of an unnecessary check before the function call ipcomp_free_tfms
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 linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: net: xfrm: Deletion of an unnecessary check before the function call ipcomp_free_tfms
I have come to view you as a very clever troll. You will say infuriating things like That is an interesting background information but the function implementation update suggestion is correct and pretend to not see the bug for nine emails. Then you'll say something Ha ha, I audited all the call trees and it can't actually be NULL so you were getting angry for no reason. Except you'll say it in a more obfuscated way than that. This is what you did last time. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: net: xfrm: Deletion of an unnecessary check before the function call ipcomp_free_tfms
From: Dan Carpenter dan.carpen...@oracle.com Date: Wed, 19 Nov 2014 13:10:03 +0300 I have come to view you as a very clever troll. +1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/1] net: xfrm: Deletion of an unnecessary check before the function call "ipcomp_free_tfms"
From: Markus Elfring Date: Tue, 18 Nov 2014 21:41:26 +0100 The ipcomp_free_tfms() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- net/xfrm/xfrm_ipcomp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index ccfdc71..47863cd 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -320,8 +320,7 @@ error: static void ipcomp_free_data(struct ipcomp_data *ipcd) { - if (ipcd->tfms) - ipcomp_free_tfms(ipcd->tfms); + ipcomp_free_tfms(ipcd->tfms); ipcomp_free_scratches(); } -- 2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/1] net: xfrm: Deletion of an unnecessary check before the function call ipcomp_free_tfms
From: Markus Elfring elfr...@users.sourceforge.net Date: Tue, 18 Nov 2014 21:41:26 +0100 The ipcomp_free_tfms() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring elfr...@users.sourceforge.net --- net/xfrm/xfrm_ipcomp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index ccfdc71..47863cd 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -320,8 +320,7 @@ error: static void ipcomp_free_data(struct ipcomp_data *ipcd) { - if (ipcd-tfms) - ipcomp_free_tfms(ipcd-tfms); + ipcomp_free_tfms(ipcd-tfms); ipcomp_free_scratches(); } -- 2.1.3 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/