Re: [PATCH] staging: most: cdev: fix chrdev_region leak in mod_exit

From: Christian.Gromm
Date: Thu May 02 2019 - 04:03:24 EST


On Mi, 2019-04-24 at 21:23 +0200, Eugeniu Rosca wrote:
> External E-Mail
>
>
> From: Suresh Udipi <sudipi@xxxxxxxxxxxxxx>
>
> It looks like v4.18-rc1 commit [0] which upstreams mld-1.8.0
> commit [1] missed to fix the memory leak in mod_exit function.
>
> Do it now.
>
> [0] aba258b7310167 ("staging: most: cdev: fix chrdev_region leak")
> [1] https://github.com/microchip-ais/linux/commit/a2d8f7ae7ea381
> ÂÂÂÂ("staging: most: cdev: fix leak for chrdev_region")
>
> Signed-off-by: Suresh Udipi <sudipi@xxxxxxxxxxxxxx>
> Signed-off-by: Eugeniu Rosca <erosca@xxxxxxxxxxxxxx>

Acked-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx>

> ---
> Âdrivers/staging/most/cdev/cdev.c | 2 +-
> Â1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/most/cdev/cdev.c
> b/drivers/staging/most/cdev/cdev.c
> index f2b347cda8b7..d5f236889021 100644
> --- a/drivers/staging/most/cdev/cdev.c
> +++ b/drivers/staging/most/cdev/cdev.c
> @@ -549,7 +549,7 @@ static void __exit mod_exit(void)
> Â destroy_cdev(c);
> Â destroy_channel(c);
> Â }
> - unregister_chrdev_region(comp.devno, 1);
> + unregister_chrdev_region(comp.devno, CHRDEV_REGION_SIZE);
> Â ida_destroy(&comp.minor_id);
> Â class_destroy(comp.class);
> Â}