diff mbox

qedf: fix ifnullfree.cocci warnings

Message ID 20170214021308.GA24773@intel11.lkp.intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

kernel test robot Feb. 14, 2017, 2:13 a.m. UTC
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 <chad.dupuis@cavium.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

 qedf_main.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox


--- 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
-	if (qedf->global_queues)
-		kfree(qedf->global_queues);
+	kfree(qedf->global_queues);