lkml.org 
[lkml]   [2019]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] md: Fix failed allocation of md_register_thread
On Mon, Mar 4, 2019 at 2:50 PM Aditya Pakki <pakki001@umn.edu> 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>

This looks good. Could you please add a "Fixed:" tag?

Thanks,
Song

> ---
> 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;
> --
> 2.17.1
>

\
 
 \ /
  Last update: 2019-03-06 17:59    [W:0.065 / U:2.628 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site