linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: majianpeng <majianpeng@gmail.com>
Cc: linux-raid <linux-raid@vger.kernel.org>
Subject: Re: md/linear: If md_integrity_register() failed,linear_run() must free the mem.
Date: Tue, 27 Mar 2012 13:17:38 +1100	[thread overview]
Message-ID: <20120327131738.5766f47f@notabene.brown> (raw)
In-Reply-To: <201203231029159680193@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]

On Fri, 23 Mar 2012 10:29:19 +0800 "majianpeng" <majianpeng@gmail.com> wrote:

> >From df3b2e15fb325def8f5eaa076b328084dd86c421 Mon Sep 17 00:00:00 2001
> From: majianpeng <majianpeng@gmail.com>
> Date: Fri, 23 Mar 2012 10:09:18 +0800
> Subject: [PATCH] md/linear: If md_integrity_register() failed,linear_run()
>  must  free the mem.
> 
> 
> Signed-off-by: majianpeng <majianpeng@gmail.com>
> ---
>  drivers/md/linear.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/md/linear.c b/drivers/md/linear.c
> index b0fcc7d..fa211d8 100644
> --- a/drivers/md/linear.c
> +++ b/drivers/md/linear.c
> @@ -198,6 +198,7 @@ out:
>  static int linear_run (struct mddev *mddev)
>  {
>  	struct linear_conf *conf;
> +	int ret;
>  
>  	if (md_check_no_bitmap(mddev))
>  		return -EINVAL;
> @@ -211,7 +212,13 @@ static int linear_run (struct mddev *mddev)
>  	blk_queue_merge_bvec(mddev->queue, linear_mergeable_bvec);
>  	mddev->queue->backing_dev_info.congested_fn = linear_congested;
>  	mddev->queue->backing_dev_info.congested_data = mddev;
> -	return md_integrity_register(mddev);
> +
> +	ret =  md_integrity_register(mddev);
> +	if (ret) {
> +		kfree(conf);
> +		mddev->private = NULL;
> +	}
> +	return ret;
>  }
>  
>  static int linear_add(struct mddev *mddev, struct md_rdev *rdev)


Applied, thanks.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2012-03-27  2:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23  2:29 md/linear: If md_integrity_register() failed,linear_run() must free the mem majianpeng
2012-03-27  2:17 ` NeilBrown [this message]

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=20120327131738.5766f47f@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=majianpeng@gmail.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).