提交 f8b00e0f 编写于 作者: Z zhong jiang 提交者: 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: Nzhong jiang <zhongjiang@huawei.com>
Reviewed-by: NNikolay Borisov <nborisov@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册