From: "majianpeng" <majianpeng@gmail.com>
To: Neil Brown <neilb@suse.de>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: md/raid0: If md_integrity_register() failed,raid0_run() must free the mem.
Date: Fri, 23 Mar 2012 10:30:09 +0800 [thread overview]
Message-ID: <201203231030029373801@gmail.com> (raw)
From 3d07b1d34ee2dcb1abd599a90855f1a5c30c3de6 Mon Sep 17 00:00:00 2001
From: majianpeng <majianpeng@gmail.com>
Date: Fri, 23 Mar 2012 10:04:57 +0800
Subject: [PATCH] md/raid0: If md_integrity_register() failed,raid0_run() must
free the mem.
Signed-off-by: majianpeng <majianpeng@gmail.com>
---
drivers/md/raid0.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 6f31f55..5a99cde 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -454,7 +454,15 @@ static int raid0_run(struct mddev *mddev)
blk_queue_merge_bvec(mddev->queue, raid0_mergeable_bvec);
dump_zones(mddev);
- return md_integrity_register(mddev);
+
+ ret = md_integrity_register(mddev);
+ if (ret) {
+ kfree(conf->strip_zone);
+ kfree(conf->devlist);
+ kfree(conf);
+ mddev->private = NULL;
+ }
+ return ret;
}
static int raid0_stop(struct mddev *mddev)
--
1.7.5.4
--------------
majianpeng
2012-03-23
next reply other threads:[~2012-03-23 2:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-23 2:30 majianpeng [this message]
2012-03-27 2:18 ` md/raid0: If md_integrity_register() failed,raid0_run() must free the mem NeilBrown
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=201203231030029373801@gmail.com \
--to=majianpeng@gmail.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/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).