Skip to content

Commit 5f7ef48

Browse files
Dan Carpenterliu-song-6
authored andcommitted
md/raid5: missing error code in setup_conf()
Return -ENOMEM if the allocation fails. Don't return success. Fixes: 8fbcba6 ("md/raid5: Cleanup setup_conf() error returns") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]> Signed-off-by: Song Liu <[email protected]>
1 parent 957a2b3 commit 5f7ef48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/md/raid5.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7304,7 +7304,9 @@ static struct r5conf *setup_conf(struct mddev *mddev)
73047304
goto abort;
73057305
conf->mddev = mddev;
73067306

7307-
if ((conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL)) == NULL)
7307+
ret = -ENOMEM;
7308+
conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL);
7309+
if (!conf->stripe_hashtbl)
73087310
goto abort;
73097311

73107312
/* We init hash_locks[0] separately to that it can be used

0 commit comments

Comments
 (0)