From: Wang Shilong Date: Thu, 8 Aug 2013 05:04:17 +0000 (+0800) Subject: Btrfs: fix possible memory leak in find_parent_nodes() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=a4fdb61e81e73991d919ff0396d256e9e67d2475;p=openwrt%2Fstaging%2Fblogic.git Btrfs: fix possible memory leak in find_parent_nodes() Signed-off-by: Wang Shilong Reviewed-by: Miao Xie Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 980e85a264c0..ae798c1d088b 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -911,7 +911,6 @@ again: while (!list_empty(&prefs)) { ref = list_first_entry(&prefs, struct __prelim_ref, list); - list_del(&ref->list); WARN_ON(ref->count < 0); if (ref->count && ref->root_id && ref->parent == 0) { /* no parent == root of tree */ @@ -956,6 +955,7 @@ again: eie->next = ref->inode_list; } } + list_del(&ref->list); kfree(ref); }