From: chandan <chandan@linux.vnet.ibm.com>
To: linux-btrfs@vger.kernel.org, sekharan@us.ibm.com
Subject: [PATCH v2] btrfs-progs: clear_extent_bits: Fix memory leak.
Date: Fri, 20 Sep 2013 23:52:11 +0530 [thread overview]
Message-ID: <2008646.Qy2BWpenWU@localhost.localdomain> (raw)
The 'prealloc' extent_state structure is leaked for the case when the 'desired
range' encapsulates/covers the 'extent range'.
Signed-off-by: chandan <chandan@linux.vnet.ibm.com>
---
v1->v2: Fix commit message.
---
extent_io.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/extent_io.c b/extent_io.c
index acc4702..1c481d5 100644
--- a/extent_io.c
+++ b/extent_io.c
@@ -210,9 +210,11 @@ int clear_extent_bits(struct extent_io_tree *tree, u64 start,
int set = 0;
again:
- prealloc = alloc_extent_state();
- if (!prealloc)
- return -ENOMEM;
+ if (!prealloc) {
+ prealloc = alloc_extent_state();
+ if (!prealloc)
+ return -ENOMEM;
+ }
/*
* this search will find the extents that end after
--
1.8.3.1
reply other threads:[~2013-09-20 18:22 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=2008646.Qy2BWpenWU@localhost.localdomain \
--to=chandan@linux.vnet.ibm.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=sekharan@us.ibm.com \
/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).