projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
57ba86c
)
Btrfs: fix memory leak in name_cache_insert()
author
Tsutomu Itoh
<t-itoh@jp.fujitsu.com>
Mon, 17 Dec 2012 06:38:51 +0000
(06:38 +0000)
committer
Josef Bacik
<josef@toxicpanda.com>
Mon, 14 Jan 2013 18:52:30 +0000
(13:52 -0500)
We should free name_cache_entry before returning from the
error handling code.
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
fs/btrfs/send.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/btrfs/send.c
b/fs/btrfs/send.c
index 54454542ad4073352ddcabf27fd9e0bc528e2136..321b7fb4e4417573e9c404069c6b249afb8ab488 100644
(file)
--- a/
fs/btrfs/send.c
+++ b/
fs/btrfs/send.c
@@
-1814,8
+1814,10
@@
static int name_cache_insert(struct send_ctx *sctx,
(unsigned long)nce->ino);
if (!nce_head) {
nce_head = kmalloc(sizeof(*nce_head), GFP_NOFS);
- if (!nce_head)
+ if (!nce_head) {
+ kfree(nce);
return -ENOMEM;
+ }
INIT_LIST_HEAD(nce_head);
ret = radix_tree_insert(&sctx->name_cache, nce->ino, nce_head);