Thread (6 messages) flat view 6 messages, 3 authors, 2017-02-14
STALE3497d

[PATCH] qedf: fix ifnullfree.cocci warnings

From: kbuild test robot <hidden>
Date: 2017-02-14 02:13:08
Also in: linux-scsi

drivers/scsi/qedf/qedf_main.c:2742: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

CC: Dupuis, Chad <redacted>
Signed-off-by: Fengguang Wu <redacted>
---

 qedf_main.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -2738,8 +2738,7 @@ static void qedf_free_fcoe_pf_param(stru
 
 	qedf_free_global_queues(qedf);
 
-	if (qedf->global_queues)
-		kfree(qedf->global_queues);
+	kfree(qedf->global_queues);
 }
 
 /*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help