public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipv6: fix ifnullfree.cocci warnings
       [not found] <201509100609.fhjHrskx%fengguang.wu@intel.com>
@ 2015-09-09 22:57 ` kbuild test robot
  2015-09-10  0:21   ` David Miller
  2015-09-10  5:08   ` roopa
  0 siblings, 2 replies; 3+ messages in thread
From: kbuild test robot @ 2015-09-09 22:57 UTC (permalink / raw)
  To: Roopa Prabhu
  Cc: kbuild-all, Nikolay Aleksandrov, netdev, Alexey Kuznetsov,
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy, linux-kernel

net/ipv6/route.c:2946:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

CC: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 route.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2942,8 +2942,7 @@ cleanup:
 	list_for_each_entry_safe(nh, nh_safe, &rt6_nh_list, next) {
 		if (nh->rt6_info)
 			dst_free(&nh->rt6_info->dst);
-		if (nh->mxc.mx)
-			kfree(nh->mxc.mx);
+		kfree(nh->mxc.mx);
 		list_del(&nh->next);
 		kfree(nh);
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv6: fix ifnullfree.cocci warnings
  2015-09-09 22:57 ` [PATCH] ipv6: fix ifnullfree.cocci warnings kbuild test robot
@ 2015-09-10  0:21   ` David Miller
  2015-09-10  5:08   ` roopa
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-09-10  0:21 UTC (permalink / raw)
  To: fengguang.wu
  Cc: roopa, kbuild-all, nikolay, netdev, kuznet, jmorris, yoshfuji,
	kaber, linux-kernel

From: kbuild test robot <fengguang.wu@intel.com>
Date: Thu, 10 Sep 2015 06:57:12 +0800

> net/ipv6/route.c:2946:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
> 
>  NULL check before some freeing functions is not needed.
> 
>  Based on checkpatch warning
>  "kfree(NULL) is safe this check is probably not required"
>  and kfreeaddr.cocci by Julia Lawall.
> 
> Generated by: scripts/coccinelle/free/ifnullfree.cocci
> 
> CC: Roopa Prabhu <roopa@cumulusnetworks.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ipv6: fix ifnullfree.cocci warnings
  2015-09-09 22:57 ` [PATCH] ipv6: fix ifnullfree.cocci warnings kbuild test robot
  2015-09-10  0:21   ` David Miller
@ 2015-09-10  5:08   ` roopa
  1 sibling, 0 replies; 3+ messages in thread
From: roopa @ 2015-09-10  5:08 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, Nikolay Aleksandrov, netdev, Alexey Kuznetsov,
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy, linux-kernel

On 9/9/15, 3:57 PM, kbuild test robot wrote:
> net/ipv6/route.c:2946:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
>
>   NULL check before some freeing functions is not needed.
>
>   Based on checkpatch warning
>   "kfree(NULL) is safe this check is probably not required"
>   and kfreeaddr.cocci by Julia Lawall.
>
> Generated by: scripts/coccinelle/free/ifnullfree.cocci
>
> CC: Roopa Prabhu <roopa@cumulusnetworks.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
>
FWIW, Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-10  5:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <201509100609.fhjHrskx%fengguang.wu@intel.com>
2015-09-09 22:57 ` [PATCH] ipv6: fix ifnullfree.cocci warnings kbuild test robot
2015-09-10  0:21   ` David Miller
2015-09-10  5:08   ` roopa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox