public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Neil Brown <neilb@suse.de>
Cc: Andre Noll <maan@systemlinux.org>,
	Robert Becker <Rob.Becker@riverbed.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Jens Axboe <jens.axboe@oracle.com>,
	linux-raid@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] md/raid10: check for ERR_PTR returns from setup_conf()
Date: Tue, 25 May 2010 09:40:17 +0000	[thread overview]
Message-ID: <20100525094017.GD22515@bicker> (raw)

setup_conf() can return error values so I added a check for that here.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 0372499..8bd7da2 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2454,6 +2454,8 @@ static void *raid10_takeover_raid0(mddev_t *mddev)
 	mddev->recovery_cp = MaxSector;
 
 	conf = setup_conf(mddev);
+	if (IS_ERR(conf))
+		return conf;
 	conf->scale_disks = 2;
 	return conf;
 }

             reply	other threads:[~2010-05-25  9:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-25  9:40 Dan Carpenter [this message]
2010-05-25 14:56 ` [patch] md/raid10: check for ERR_PTR returns from setup_conf() Andre Noll

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=20100525094017.GD22515@bicker \
    --to=error27@gmail.com \
    --cc=Rob.Becker@riverbed.com \
    --cc=jens.axboe@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=maan@systemlinux.org \
    --cc=martin.petersen@oracle.com \
    --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