twx-linux/drivers/base
Shyam Saini 8f2451ebaf drivers: base: handle module_kobject creation
[ Upstream commit f95bbfe18512c5c018720468959edac056a17196 ]

module_add_driver() relies on module_kset list for
/sys/module/<built-in-module>/drivers directory creation.

Since,
commit 96a1a2412acba ("kernel/params.c: defer most of param_sysfs_init() to late_initcall time")
drivers which are initialized from subsys_initcall() or any other
higher precedence initcall couldn't find the related kobject entry
in the module_kset list because module_kset is not fully populated
by the time module_add_driver() refers it. As a consequence,
module_add_driver() returns early without calling make_driver_name().
Therefore, /sys/module/<built-in-module>/drivers is never created.

Fix this issue by letting module_add_driver() handle module_kobject
creation itself.

Fixes: 96a1a2412acb ("kernel/params.c: defer most of param_sysfs_init() to late_initcall time")
Cc: stable@vger.kernel.org # requires all other patches from the series
Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Shyam Saini <shyamsaini@linux.microsoft.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250227184930.34163-5-shyamsaini@linux.microsoft.com
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-05-09 09:44:07 +02:00
..
firmware_loader firmware_loader: Fix possible resource leak in fw_log_firmware_info() 2024-12-09 10:32:37 +01:00
power PM: sleep: Fix handling devices with direct_complete set on errors 2025-04-10 14:37:26 +02:00
regmap regmap-irq: Add missing kfree() 2025-02-21 13:57:19 +01:00
test drivers: base: test: Add missing MODULE_* macros to root device tests 2023-08-16 19:01:29 +02:00
arch_numa.c arm64: irq: set the correct node for VMAP stack 2024-02-05 20:14:14 +00:00
arch_topology.c
attribute_container.c
auxiliary.c
base.h driver core: fix potential NULL pointer dereference in dev_uevent() 2025-05-02 07:51:03 +02:00
bus.c driver core: fix potential NULL pointer dereference in dev_uevent() 2025-05-02 07:51:03 +02:00
cacheinfo.c cacheinfo: Allocate memory during CPU hotplug if not done from the primary CPU 2024-12-14 19:59:55 +01:00
class.c driver core: class: Fix wild pointer dereferences in API class_dev_iter_next() 2025-02-08 09:52:27 +01:00
component.c
container.c
core.c driver core: fix potential NULL pointer dereference in dev_uevent() 2025-05-02 07:51:03 +02:00
cpu.c x86/rfds: Mitigate Register File Data Sampling (RFDS) 2024-03-15 10:48:22 -04:00
dd.c driver core: introduce device_set_driver() helper 2025-05-02 07:51:03 +02:00
devcoredump.c devcoredump: Send uevent once devcd is ready 2023-12-13 18:45:33 +01:00
devres.c drivers: base: devres: Allow to release group on device release 2025-04-25 10:45:18 +02:00
devtmpfs.c
driver.c
firmware.c
hypervisor.c
init.c
isa.c
Kconfig
Makefile
map.c
memory.c mm/memory_hotplug: add missing mem_hotplug_lock 2023-12-13 18:45:24 +01:00
module.c drivers: base: handle module_kobject creation 2025-05-09 09:44:07 +02:00
node.c base/node.c: initialize the accessor list before registering 2024-01-25 15:35:51 -08:00
physical_location.c
physical_location.h
pinctrl.c
platform-msi.c
platform.c of: Move of_platform_register_reconfig_notifier() into DT core 2023-08-04 11:36:33 -06:00
property.c
soc.c
swnode.c software node: Let args be NULL in software_node_get_reference_args 2024-01-25 15:35:51 -08:00
syscore.c
topology.c topology: Keep the cpumask unchanged when printing cpumap 2025-01-17 13:36:20 +01:00
trace.c
trace.h
transport_class.c