Skip to content

Commit 5e56bc0

Browse files
cgrogregkh
authored andcommitted
most: core: use function subsys_initcall()
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@microchip.com> Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/r/1587741394-22021-1-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 522587e commit 5e56bc0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/most/core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ static void __exit most_exit(void)
14831483
ida_destroy(&mdev_id);
14841484
}
14851485

1486-
module_init(most_init);
1486+
subsys_initcall(most_init);
14871487
module_exit(most_exit);
14881488
MODULE_LICENSE("GPL");
14891489
MODULE_AUTHOR("Christian Gromm <christian.gromm@microchip.com>");

0 commit comments

Comments
 (0)