aboutsummaryrefslogtreecommitdiffstats
path: root/volumes.c
diff options
context:
space:
mode:
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>2013-12-12 18:41:07 +0800
committerChris Mason <clm@fb.com>2014-01-31 08:22:17 -0800
commit3cae13ee934311b438ea15e773bc5c7d965d1cd8 (patch)
tree35ac1175f20ba9a6b317e2f40d93ee639d389942 /volumes.c
parente3c9596d3fc8b0df647a6cbae55c2d77570de759 (diff)
downloadbtrfs-progs-3cae13ee934311b438ea15e773bc5c7d965d1cd8.tar.gz
btrfs-progs-3cae13ee934311b438ea15e773bc5c7d965d1cd8.tar.xz
btrfs-progs-3cae13ee934311b438ea15e773bc5c7d965d1cd8.zip
btrfs-progs: remove NULL-ptr judge before free for btrfs-progs
free(3) already checks the pointer for NULL, no need to do it on your own. This patch make the change globally. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'volumes.c')
-rw-r--r--volumes.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/volumes.c b/volumes.c
index bd01270..e25b4c0 100644
--- a/volumes.c
+++ b/volumes.c
@@ -1267,13 +1267,11 @@ int __btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw,
again:
ce = search_cache_extent(&map_tree->cache_tree, logical);
if (!ce) {
- if (multi)
- kfree(multi);
+ kfree(multi);
return -ENOENT;
}
if (ce->start > logical || ce->start + ce->size < logical) {
- if (multi)
- kfree(multi);
+ kfree(multi);
return -ENOENT;
}