Commit f8b00e0f authored by zhong jiang's avatar zhong jiang Committed by David Sterba
Browse files

btrfs: remove unneeded NULL checks before kfree



Kfree has taken the NULL pointer into account. So remove the check
before kfree.

The issue is detected with the help of Coccinelle.

Signed-off-by: default avatarzhong jiang <zhongjiang@huawei.com>
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 4b6f8e96
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -2110,7 +2110,6 @@ new_bitmap:

out:
	if (info) {
		if (info->bitmap)
		kfree(info->bitmap);
		kmem_cache_free(btrfs_free_space_cachep, info);
	}
@@ -3601,7 +3600,6 @@ again:

	if (info)
		kmem_cache_free(btrfs_free_space_cachep, info);
	if (map)
	kfree(map);
	return 0;
}