projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cc2b702
)
btrfs: fix memory leak in update_space_info failure path
author
Jeff Mahoney
<
[email protected]
>
Wed, 17 May 2017 13:49:37 +0000
(09:49 -0400)
committer
David Sterba
<
[email protected]
>
Thu, 1 Jun 2017 14:56:31 +0000
(16:56 +0200)
If we fail to add the space_info kobject, we'll leak the memory
for the percpu counter.
Fixes: 6ab0a2029c (btrfs: publish allocation data in sysfs)
Cc: <
[email protected]
> # v3.14+
Signed-off-by: Jeff Mahoney <
[email protected]
>
Reviewed-by: Liu Bo <
[email protected]
>
Signed-off-by: David Sterba <
[email protected]
>
fs/btrfs/extent-tree.c
patch
|
blob
|
history
diff --git
a/fs/btrfs/extent-tree.c
b/fs/btrfs/extent-tree.c
index e390451c72e6cdb93492e519cea82d5d7b3dfaf9..27ca5b81ed22051e771d65d4d74967d874ad7004 100644
(file)
--- a/
fs/btrfs/extent-tree.c
+++ b/
fs/btrfs/extent-tree.c
@@
-3993,6
+3993,7
@@
static int update_space_info(struct btrfs_fs_info *info, u64 flags,
info->space_info_kobj, "%s",
alloc_name(found->flags));
if (ret) {
+ percpu_counter_destroy(&found->total_bytes_pinned);
kfree(found);
return ret;
}