platform/x86: dell-smo8800: Suppress bind attributes of the platform driver
Subsystems (2)
PATCH 1/1 platform/x86: dell-smo8800: Suppress bind attributes of the platform driver
struct smo8800_device, which holds the misc device and its wait queue, is allocated with devm_kzalloc() and freed when the device is unbound. misc_deregister() does not close files that are already open, so if /dev/freefall is open when the driver is unbound through sysfs, a reader blocked in smo8800_misc_read() is left sleeping on a wait queue in freed memory, and smo8800_misc_release() later clears a bit in it.
Module removal is not affected, since an open /dev/freefall holds a reference to the module. Unbinding by hand is the only other way to remove the device, and it is not useful, so hide the bind and unbind files.
---
Developed with the help of an AI coding assistant (Claude Opus 5.5),
which found the issue and drafted the fix; I reviewed it and am
responsible for it. Builds cleanly with W=1.
Tested on a Dell Precision M4800 running v7.2.15, using the equivalent backports built as out-of-tree modules: the driver loads and the bind/unbind files are gone.
drivers/platform/x86/dell/dell-smo8800.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/dell/dell-smo8800.c +1 -0
@@ -169,6 +169,7 @@ static struct platform_driver smo8800_driver = { .driver = { .name = DRIVER_NAME, .acpi_match_table = smo8800_ids, + .suppress_bind_attrs = true, }, };module_platform_driver (smo8800_driver);
base-commit: 2800868f63227c8237d70c41e70d441c919620d6
Signature · 1 line
2.56.0