From 08ff39f1c8f2134f7d0f38123ca5952371665cc5 Mon Sep 17 00:00:00 2001 From: Sven Wegener Date: Thu, 16 Oct 2008 14:16:53 +1100 Subject: md: check for memory allocation failure in faulty personality It's a fault injection module, but I don't think we should oops here. Signed-off-by: Sven Wegener Signed-off-by: Andrew Morton Signed-off-by: Neil Brown --- drivers/md/faulty.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c index 268547dbfbd..f26c1f9a475 100644 --- a/drivers/md/faulty.c +++ b/drivers/md/faulty.c @@ -287,6 +287,8 @@ static int run(mddev_t *mddev) int i; conf_t *conf = kmalloc(sizeof(*conf), GFP_KERNEL); + if (!conf) + return -ENOMEM; for (i=0; icounters[i], 0); -- cgit v1.2.3-70-g09d2