From: Mariusz Kozlowski <mk@lab.zgora.pl>
To: Chris Mason <chris.mason@oracle.com>
Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Mariusz Kozlowski <mk@lab.zgora.pl>
Subject: [PATCH] btrfs: fix memory leak on error path in btrfs_get_acl()
Date: Wed, 15 Dec 2010 22:57:36 +0100 [thread overview]
Message-ID: <1292450256-4544-1-git-send-email-mk@lab.zgora.pl> (raw)
If posix_acl_from_xattr() fails we leak memory stored in 'value'.
Signed-off-by: Mariusz Kozlowski <mk@lab.zgora.pl>
---
fs/btrfs/acl.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index 2222d16..11c9561 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -61,6 +61,7 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
if (size > 0) {
acl = posix_acl_from_xattr(value, size);
if (IS_ERR(acl))
+ kfree(value);
return acl;
set_cached_acl(inode, type, acl);
}
--
1.7.0.4
next reply other threads:[~2010-12-15 21:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 21:57 Mariusz Kozlowski [this message]
2010-12-15 22:49 ` [PATCH] btrfs: fix memory leak on error path in btrfs_get_acl() Miguel Ojeda
2010-12-16 5:56 ` Mariusz Kozlowski
2010-12-16 6:10 ` [PATCH v2] " Mariusz Kozlowski
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=1292450256-4544-1-git-send-email-mk@lab.zgora.pl \
--to=mk@lab.zgora.pl \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).