summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2022-07-19 11:48:01 +0200
committerSong Liu <song@kernel.org>2022-07-19 19:58:33 +0200
commit5f7ef4875f99538b741527963ffe09e869b49826 (patch)
tree0097e4bad8f7088c5401a6a71acd0ac05ee30fb9 /drivers/md/raid5.c
parentblock: fix missing blkcg_bio_issue_init (diff)
downloadlinux-5f7ef4875f99538b741527963ffe09e869b49826.tar.xz
linux-5f7ef4875f99538b741527963ffe09e869b49826.zip
md/raid5: missing error code in setup_conf()
Return -ENOMEM if the allocation fails. Don't return success. Fixes: 8fbcba6b999b ("md/raid5: Cleanup setup_conf() error returns") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 5d09256d7f81..96c3a1185781 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7304,7 +7304,9 @@ static struct r5conf *setup_conf(struct mddev *mddev)
goto abort;
conf->mddev = mddev;
- if ((conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL)) == NULL)
+ ret = -ENOMEM;
+ conf->stripe_hashtbl = kzalloc(PAGE_SIZE, GFP_KERNEL);
+ if (!conf->stripe_hashtbl)
goto abort;
/* We init hash_locks[0] separately to that it can be used