From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com ([134.134.136.65]:25967 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932906AbbIVRzH (ORCPT ); Tue, 22 Sep 2015 13:55:07 -0400 Date: Wed, 23 Sep 2015 01:54:26 +0800 From: kbuild test robot To: Mark Fasheh Cc: kbuild-all@01.org, Josef Bacik , linux-btrfs@vger.kernel.org Subject: [PATCH] fix ifnullfree.cocci warnings Message-ID: <20150922175426.GA62109@xian> References: <201509230124.0LoGc02q%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <201509230124.0LoGc02q%fengguang.wu@intel.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: 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 Signed-off-by: Fengguang Wu --- 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