mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-21 17:51:17 +07:00
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: zhong jiang <zhongjiang@huawei.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
4b6f8e9695
commit
f8b00e0f06
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user