Skip to content

Commit

Permalink
md: check for memory allocation failure in faulty personality
Browse files Browse the repository at this point in the history
It's a fault injection module, but I don't think we should oops here.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Neil Brown <neilb@suse.de>
  • Loading branch information
Sven Wegener authored and NeilBrown committed Oct 16, 2008
1 parent 2557072 commit 08ff39f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/md/faulty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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; i<Modes; i++) {
atomic_set(&conf->counters[i], 0);
Expand Down

0 comments on commit 08ff39f

Please sign in to comment.