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

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
......@@ -2110,8 +2110,7 @@ static int insert_into_bitmap(struct btrfs_free_space_ctl *ctl,
out:
if (info) {
if (info->bitmap)
kfree(info->bitmap);
kfree(info->bitmap);
kmem_cache_free(btrfs_free_space_cachep, info);
}
......@@ -3601,8 +3600,7 @@ int test_add_free_space_entry(struct btrfs_block_group_cache *cache,
if (info)
kmem_cache_free(btrfs_free_space_cachep, info);
if (map)
kfree(map);
kfree(map);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment