* [PATCH] fix ifnullfree.cocci warnings
2015-09-22 17:54 [josef-btrfs:enospc-rework 1/9] fs/btrfs/qgroup.c:1463: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 kbuild test robot
@ 2015-09-22 17:54 ` kbuild test robot
0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2015-09-22 17:54 UTC (permalink / raw)
To: Mark Fasheh; +Cc: kbuild-all, Josef Bacik, linux-btrfs
fs/btrfs/qgroup.c:1463: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: Mark Fasheh <mfasheh@suse.de>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
qgroup.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1459,8 +1459,7 @@ struct btrfs_qgroup_extent_record *btrfs
void btrfs_qgroup_free_extent_record(struct btrfs_qgroup_extent_record *record)
{
- if (record)
- kfree(record);
+ kfree(record);
}
struct btrfs_qgroup_extent_record
^ permalink raw reply [flat|nested] 2+ messages in thread
* [josef-btrfs:enospc-rework 1/9] fs/btrfs/qgroup.c:1463: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.
@ 2015-09-22 17:54 kbuild test robot
2015-09-22 17:54 ` [PATCH] fix ifnullfree.cocci warnings kbuild test robot
0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2015-09-22 17:54 UTC (permalink / raw)
To: Mark Fasheh; +Cc: kbuild-all, Josef Bacik, linux-btrfs
tree: https://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git enospc-rework
head: ea67b575b6cd2be0775ddd1ff66968d11288f2c6
commit: 1aa3e6f33600e899b38591d9da156dfdb37ea325 [1/9] Major qgroup regression in 4.2?
coccinelle warnings: (new ones prefixed by >>)
>> fs/btrfs/qgroup.c:1463: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.
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] 2+ messages in thread
end of thread, other threads:[~2015-09-22 17:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 17:54 [josef-btrfs:enospc-rework 1/9] fs/btrfs/qgroup.c:1463: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 kbuild test robot
2015-09-22 17:54 ` [PATCH] fix ifnullfree.cocci warnings kbuild test robot
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).