[patch] md/raid10: check for ERR_PTR returns from setup_conf()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>

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;
 }
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux