From: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
To: Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: [PATCH] btrfs: Fix memory leak in btrfs_read_fs_root_no_radix()
Date: Mon, 27 Dec 2010 15:53:10 +0900 [thread overview]
Message-ID: <4D1837D6.4080901@jp.fujitsu.com> (raw)
In btrfs_read_fs_root_no_radix(), 'root' is not freed if
btrfs_search_slot() returns error.
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
---
disk-io.c | 1 +
1 file changed, 1 insertion(+)
diff -urNp linux-2.6.37-rc7/fs/btrfs/disk-io.c linux-2.6.37-rc7.new/fs/btrfs/disk-io.c
--- linux-2.6.37-rc7/fs/btrfs/disk-io.c 2010-12-22 04:26:40.000000000 +0900
+++ linux-2.6.37-rc7.new/fs/btrfs/disk-io.c 2010-12-27 15:21:19.000000000 +0900
@@ -1145,6 +1145,7 @@ struct btrfs_root *btrfs_read_fs_root_no
}
btrfs_free_path(path);
if (ret) {
+ kfree(root);
if (ret > 0)
ret = -ENOENT;
return ERR_PTR(ret);
reply other threads:[~2010-12-27 6:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D1837D6.4080901@jp.fujitsu.com \
--to=t-itoh@jp.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.