From: Logan Gunthorpe <logang@deltatee.com>
To: Dan Carpenter <dan.carpenter@oracle.com>, Song Liu <song@kernel.org>
Cc: linux-raid@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] md/raid5: missing error code in setup_conf()
Date: Tue, 19 Jul 2022 10:57:45 -0600 [thread overview]
Message-ID: <909f1c33-27e3-3f3a-7d8d-ba6fdb57cdb3@deltatee.com> (raw)
In-Reply-To: <YtZ90ZYlrVvucwr9@kili>
On 2022-07-19 03:48, Dan Carpenter wrote:
> 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>
Oops, nice catch.
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Thanks,
Logan
> ---
> drivers/md/raid5.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index a7db73d36cc4..f31012357572 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -7492,7 +7492,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
next prev parent reply other threads:[~2022-07-19 16:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-19 9:48 [PATCH] md/raid5: missing error code in setup_conf() Dan Carpenter
2022-07-19 16:57 ` Logan Gunthorpe [this message]
2022-07-19 18:41 ` Song Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=909f1c33-27e3-3f3a-7d8d-ba6fdb57cdb3@deltatee.com \
--to=logang@deltatee.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=song@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox