diff options
| author | Maxime Austruy <[email protected]> | 2007-07-01 12:06:38 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2007-07-01 12:29:44 -0700 |
| commit | 5ebffd7c05391693b71d3326c8c78ff82f728ed0 (patch) | |
| tree | 8380be53dfe5e9e453572b64052a618ba4a2cf9f /include/linux/moduleparam.h | |
| parent | d80d02173360562625c10a526132fb87be4de2a4 (diff) | |
asus_acpi: fix oops on non-asus machines
If asus_acpi_init doesn't find any device it knows about, it mistakenly
returns a "success" error code even though it cleans up after itself. Later
when trying to rmmod asus_acpi, the module_exit routine would try to clean up
one more time and we would end up calling
acpi_bus_unregister_driver(&asus_hotk_driver) twice. This patch addresses
this first problem by returning -ENODEV when no appropriate device is found.
Then there was also another bug with the code handling the return value of
backlight_device_register. If this function ever failed, the driver would
cleanup by calling the module_exit routine from module_init, but it would
still return "success". So any attempt to rmmod this module would result in
asus_acpi_exit being called twice but it's not ready to handle it (I haven't
hit this bug, just found it by code inspection). This patch fixes that by
inserting a return -ENODEV; at the end of this error handling path.
Signed-off-by: Maxime Austruy <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Richard Purdie <[email protected]>
Cc: Jan Engelhardt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include/linux/moduleparam.h')
0 files changed, 0 insertions, 0 deletions