Orangefs: fix ifnullfree.cocci warnings
authorkbuild test robot <fengguang.wu@intel.com>
Sat, 26 Mar 2016 18:54:23 +0000 (02:54 +0800)
committerMike Marshall <hubcap@omnibond.com>
Fri, 8 Apr 2016 18:08:38 +0000 (14:08 -0400)
fs/orangefs/orangefs-debugfs.c:130:2-26: 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>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
fs/orangefs/orangefs-debugfs.c

index 19670b8b4053b49a6c40da82464ff75000bb84da..1714a737d5563ba3fd6dbbd468837b9e9f66de7e 100644 (file)
@@ -126,8 +126,7 @@ out:
 
 void orangefs_debugfs_cleanup(void)
 {
-       if (debug_dir)
-               debugfs_remove_recursive(debug_dir);
+       debugfs_remove_recursive(debug_dir);
 }
 
 /* open ORANGEFS_KMOD_DEBUG_HELP_FILE */