From: Filipe David Borba Manana Date: Sat, 12 Oct 2013 19:32:59 +0000 (+0100) Subject: Btrfs: don't leak delayed node on path allocation failure X-Git-Tag: v3.13-rc3~10^2~67 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c77bd94ecb4ad2653d1e3eb22295018533a1e21;p=platform%2Fkernel%2Flinux-exynos.git Btrfs: don't leak delayed node on path allocation failure If the path allocation failed, we would return without decrementing the reference count in the delayed node we got before, resulting in a leak. Signed-off-by: Filipe David Borba Manana Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index cbd9523..df1a496 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1174,8 +1174,10 @@ int btrfs_commit_inode_delayed_items(struct btrfs_trans_handle *trans, mutex_unlock(&delayed_node->mutex); path = btrfs_alloc_path(); - if (!path) + if (!path) { + btrfs_release_delayed_node(delayed_node); return -ENOMEM; + } path->leave_spinning = 1; block_rsv = trans->block_rsv;