mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guoqing Jiang <gqjiang@suse.com>
To: Aditya Pakki <pakki001@umn.edu>
Cc: kjlu@umn.edu, Shaohua Li <shli@kernel.org>,
	linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] md: Fix failed allocation of md_register_thread
Date: Fri, 8 Mar 2019 11:12:40 +0800	[thread overview]
Message-ID: <854b0e4a-35e4-4666-5d05-c1f9ffaceae8@suse.com> (raw)
In-Reply-To: <20190304224854.12494-1-pakki001@umn.edu>



On 3/5/19 6:48 AM, Aditya Pakki wrote:
> mddev->sync_thread can be set to NULL on kzalloc failure downstream.
> The patch checks for such a scenario and frees allocated resources.
>
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
>   drivers/md/raid10.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index abb5d382f64d..f52b4d9bcd24 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -3939,6 +3939,8 @@ static int raid10_run(struct mddev *mddev)
>   		set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
>   		mddev->sync_thread = md_register_thread(md_do_sync, mddev,
>   							"reshape");
> +		if (!mddev->sync_thread)
> +			goto out_free_conf;
>   	}
>   
>   	return 0;

Could you make the change for raid5 as well? It also doesn't check the 
failure
in raid5_run.

Thanks,
Guoqing

  parent reply	other threads:[~2019-03-08  3:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-04 22:48 Aditya Pakki
2019-03-06 16:58 ` Song Liu
2019-03-08  3:12 ` Guoqing Jiang [this message]
2019-03-12 17:22   ` 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=854b0e4a-35e4-4666-5d05-c1f9ffaceae8@suse.com \
    --to=gqjiang@suse.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=shli@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

all inboxes | Powered by JetHome®