Re: [PATCH AUTOSEL 5.6 16/62] most: core: use function subsys_initcall()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 14, 2020 at 02:51:01PM -0400, Sasha Levin wrote:
> From: Christian Gromm <christian.gromm@xxxxxxxxxxxxx>
> 
> [ Upstream commit 5e56bc06e18dfc8a66180fa369384b36e2ab621a ]
> 
> This patch replaces function module_init() with subsys_initcall().
> It is needed to ensure that the core module of the driver is
> initialized before a component tries to register with the core. This
> leads to a NULL pointer dereference if the driver is configured as
> in-tree.
> 
> Signed-off-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Link: https://lore.kernel.org/r/1587741394-22021-1-git-send-email-christian.gromm@xxxxxxxxxxxxx
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
> ---
>  drivers/staging/most/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
> index 0c4ae6920d77d..409c48c597f2f 100644
> --- a/drivers/staging/most/core.c
> +++ b/drivers/staging/most/core.c
> @@ -1484,7 +1484,7 @@ static void __exit most_exit(void)
>  	ida_destroy(&mdev_id);
>  }
>  
> -module_init(most_init);
> +subsys_initcall(most_init);
>  module_exit(most_exit);
>  MODULE_LICENSE("GPL");
>  MODULE_AUTHOR("Christian Gromm <christian.gromm@xxxxxxxxxxxxx>");

This is not needed in 5.6 and older kernels due to the most/core.c code
being in staging for these releases.  It only became an issue when it
moved out of staging.

So please drop this from here and any older trees you might have
selected it for.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux