netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RDS: IB: fix ifnullfree.cocci warnings
       [not found] <201702232002.caFuWJ4l%fengguang.wu@intel.com>
@ 2017-02-23 12:47 ` kbuild test robot
  2017-02-23 16:35   ` Santosh Shilimkar
  2017-02-24 16:11   ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: kbuild test robot @ 2017-02-23 12:47 UTC (permalink / raw)
  To: Santosh Shilimkar; +Cc: kbuild-all, linux-kernel, netdev, linux-rdma, rds-devel

net/rds/ib.c:115:2-7: 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

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -111,8 +111,7 @@ static void rds_ib_dev_free(struct work_
 		kfree(i_ipaddr);
 	}
 
-	if (rds_ibdev->vector_load)
-		kfree(rds_ibdev->vector_load);
+	kfree(rds_ibdev->vector_load);
 
 	kfree(rds_ibdev);
 }

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

* Re: [PATCH] RDS: IB: fix ifnullfree.cocci warnings
  2017-02-23 12:47 ` [PATCH] RDS: IB: fix ifnullfree.cocci warnings kbuild test robot
@ 2017-02-23 16:35   ` Santosh Shilimkar
  2017-02-24 16:11   ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Santosh Shilimkar @ 2017-02-23 16:35 UTC (permalink / raw)
  To: kbuild test robot; +Cc: kbuild-all, linux-kernel, netdev, linux-rdma, rds-devel

On 2/23/2017 4:47 AM, kbuild test robot wrote:
> net/rds/ib.c:115:2-7: 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
>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>

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

* Re: [PATCH] RDS: IB: fix ifnullfree.cocci warnings
  2017-02-23 12:47 ` [PATCH] RDS: IB: fix ifnullfree.cocci warnings kbuild test robot
  2017-02-23 16:35   ` Santosh Shilimkar
@ 2017-02-24 16:11   ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-02-24 16:11 UTC (permalink / raw)
  To: fengguang.wu
  Cc: santosh.shilimkar, kbuild-all, linux-kernel, netdev, linux-rdma,
	rds-devel

From: kbuild test robot <fengguang.wu@intel.com>
Date: Thu, 23 Feb 2017 20:47:01 +0800

> net/rds/ib.c:115:2-7: 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
> 
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Applied.

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

end of thread, other threads:[~2017-02-24 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <201702232002.caFuWJ4l%fengguang.wu@intel.com>
2017-02-23 12:47 ` [PATCH] RDS: IB: fix ifnullfree.cocci warnings kbuild test robot
2017-02-23 16:35   ` Santosh Shilimkar
2017-02-24 16:11   ` David Miller

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