netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: fix ifnullfree.cocci warnings
  2015-09-09 22:57 [net:master 30/34] 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 kbuild test robot
@ 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; 4+ 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] 4+ messages in thread

* [net:master 30/34] 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.
@ 2015-09-09 22:57 kbuild test robot
  2015-09-09 22:57 ` [PATCH] ipv6: fix ifnullfree.cocci warnings kbuild test robot
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2015-09-09 22:57 UTC (permalink / raw)
  To: Roopa Prabhu; +Cc: kbuild-all, Nikolay Aleksandrov, netdev

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
head:   f53de1e9a4aaf8cbe08845da6f7ff26a078ac507
commit: 6b9ea5a64ed5eeb3f68f2e6fcce0ed1179801d1e [30/34] ipv6: fix multipath route replace error recovery


coccinelle warnings: (new ones prefixed by >>)

>> 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.

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 4+ 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; 4+ 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] 4+ 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; 4+ 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] 4+ messages in thread

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-09 22:57 [net:master 30/34] 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 kbuild test robot
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;
as well as URLs for NNTP newsgroup(s).