From: Takahiro Yasui <tyasui@redhat.com>
To: dm-devel@redhat.com
Cc: Alasdair G Kergon <agk@redhat.com>,
Masami Hiramatsu <mhiramat@redhat.com>
Subject: [RFC][PATCH 1/4] dm-log: fix io_client_destroy leak
Date: Tue, 25 Nov 2008 19:01:37 -0500 [thread overview]
Message-ID: <492C91E1.70405@redhat.com> (raw)
In create_log_context function, dm_io_client_destroy function needs
to be called, when memory allocation of disk_header, sync_bits and
recovering_bits failed, but dm_io_client_destroy is not called.
This patch fixes it.
Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
---
drivers/md/dm-log.c | 5 +++++
1 file changed, 5 insertions(+)
Index: linux-2.6.28-rc4/drivers/md/dm-log.c
===================================================================
--- linux-2.6.28-rc4.orig/drivers/md/dm-log.c
+++ linux-2.6.28-rc4/drivers/md/dm-log.c
@@ -467,6 +467,7 @@ static int create_log_context(struct dm_
lc->disk_header = vmalloc(buf_size);
if (!lc->disk_header) {
DMWARN("couldn't allocate disk log buffer");
+ dm_io_client_destroy(lc->io_req.client);
kfree(lc);
return -ENOMEM;
}
@@ -483,6 +484,8 @@ static int create_log_context(struct dm_
if (!dev)
vfree(lc->clean_bits);
vfree(lc->disk_header);
+ if (dev)
+ dm_io_client_destroy(lc->io_req.client);
kfree(lc);
return -ENOMEM;
}
@@ -496,6 +499,8 @@ static int create_log_context(struct dm_
if (!dev)
vfree(lc->clean_bits);
vfree(lc->disk_header);
+ if (dev)
+ dm_io_client_destroy(lc->io_req.client);
kfree(lc);
return -ENOMEM;
}
next reply other threads:[~2008-11-26 0:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-26 0:01 Takahiro Yasui [this message]
2008-12-16 16:57 ` [RFC][PATCH 1/4] dm-log: fix io_client_destroy leak Jonathan Brassow
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=492C91E1.70405@redhat.com \
--to=tyasui@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=mhiramat@redhat.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 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.