linux/drivers/soundwire
Gui-Dong Han 7215e4552f soundwire: debugfs: initialize firmware_file to empty string
Passing NULL to debugfs_create_str() causes a NULL pointer dereference,
and creating debugfs nodes with NULL string pointers is no longer
permitted.

Additionally, firmware_file is a global pointer. Previously, adding every
new slave blindly overwrote it with NULL.

Fix these issues by initializing firmware_file to an allocated empty
string once in the subsystem init path (sdw_debugfs_init), and freeing
it in the exit path. Existing driver code handles empty strings
correctly.

Fixes: fe46d2a430 ("soundwire: debugfs: add interface to read/write commands")
Reported-by: yangshiguang <yangshiguang@xiaomi.com>
Closes: https://lore.kernel.org/lkml/17647e4c.d461.19b46144a4e.Coremail.yangshiguang1011@163.com/
Signed-off-by: Gui-Dong Han <hanguidong02@gmail.com>
Link: https://patch.msgid.link/20260323085930.88894-4-hanguidong02@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-04-02 16:15:23 +02:00
..
amd_init.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
amd_init.h soundwire: amd: use inline function for register update 2024-03-28 23:39:50 +05:30
amd_manager.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
amd_manager.h soundwire: amd: add soundwire host wake interrupt enable/disable sequence 2025-02-13 21:51:07 +05:30
bus.c soundwire: introduce BPT section 2025-12-08 12:37:27 +05:30
bus.h soundwire: introduce BPT section 2025-12-08 12:37:27 +05:30
bus_type.c soundwire updates for 7.0 2026-02-17 10:07:13 -08:00
cadence_master.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cadence_master.h soundwire: pass sdw_bpt_section to cdns BPT helpers 2025-12-08 12:37:27 +05:30
debugfs.c soundwire: debugfs: initialize firmware_file to empty string 2026-04-02 16:15:23 +02:00
dmi-quirks.c soundwire: dmi-quirks: add mapping for Avell B.ON (OEM rebranded of NUC15) 2025-12-16 14:41:44 +05:30
generic_bandwidth_allocation.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
intel.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
intel.h soundwire: intel: Add awareness of ACE3+ microphone privacy 2025-05-14 12:43:25 +01:00
intel_ace2x.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
intel_ace2x_debugfs.c soundwire: intel: Add awareness of ACE3+ microphone privacy 2025-05-14 12:43:25 +01:00
intel_auxdevice.c soundwire: intel_auxdevice: add cs42l45 codec to wake_capable_list 2025-12-16 14:38:38 +05:30
intel_auxdevice.h soundwire: intel: export intel_resume_child_device 2024-04-11 22:52:51 +05:30
intel_bus_common.c soundwire: cadence: add soft-reset on startup 2024-10-10 17:44:41 +05:30
intel_init.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
irq.c soundwire: bus: Add internal slave ID and use for IRQs 2025-05-14 12:42:50 +01:00
irq.h soundwire: bus: Move irq mapping cleanup into devres 2024-12-23 11:41:09 +05:30
Kconfig soundwire: intel_ace2x: add SND_HDA_CORE dependency 2025-12-30 15:01:06 +05:30
Makefile soundwire: amd: refactor amd soundwire manager device node creation 2024-01-30 16:06:34 +00:00
master.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mipi_disco.c soundwire: Correct some property names 2025-06-26 13:51:23 -07:00
qcom.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
slave.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
stream.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sysfs_local.h soundwire: sysfs: remove sdw_slave_sysfs_init() 2024-03-28 23:38:47 +05:30
sysfs_slave.c soundwire: Correct some typos in comments 2024-10-03 12:46:23 +05:30
sysfs_slave_dpn.c soundwire: sysfs: remove sdw_slave_sysfs_init() 2024-03-28 23:38:47 +05:30