kernel-hacking-2024-linux-s.../drivers/acpi
Maxime Austruy 5ebffd7c05 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 <maxime@tralhalla.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-01 12:29:44 -07:00
..
dispatcher ACPICA: Lindent 2007-05-09 23:34:35 -04:00
events ACPICA: Lindent 2007-05-09 23:34:35 -04:00
executer ACPICA: Lindent 2007-05-09 23:34:35 -04:00
hardware ACPICA: Lindent 2007-05-09 23:34:35 -04:00
namespace ACPICA: Lindent 2007-05-09 23:34:35 -04:00
parser ACPICA: Lindent 2007-05-09 23:34:35 -04:00
resources ACPICA: Lindent 2007-05-09 23:34:35 -04:00
sleep ACPICA: Lindent 2007-05-09 23:34:35 -04:00
tables ACPICA: allow Load(OEMx) tables 2007-05-29 18:29:50 -04:00
utilities ACPICA: fix error path in new external package objects as method arguments 2007-06-18 00:51:47 -04:00
ac.c
acpi_memhotplug.c
asus_acpi.c asus_acpi: fix oops on non-asus machines 2007-07-01 12:29:44 -07:00
battery.c
bay.c
blacklist.c
bus.c
button.c
cm_sbs.c
container.c
debug.c
dock.c
ec.c acpi,msi-laptop: Fall back to EC polling mode for MSI laptop specific EC commands 2007-05-10 03:52:22 -04:00
event.c
fan.c
glue.c workaround rtc-related acpi table bugs 2007-05-08 11:15:18 -07:00
Kconfig
Makefile
numa.c ACPI: Section mismatch ... acpi_map_pxm_to_node 2007-06-02 00:20:07 -04:00
osl.c ACPI: add __init to acpi_initialize_subsystem() 2007-05-30 00:26:11 -04:00
pci_bind.c
pci_irq.c
pci_link.c
pci_root.c
power.c
processor_core.c
processor_idle.c ACPI: fix 2.6.20 SMP boot regression 2007-06-23 10:57:28 -04:00
processor_perflib.c
processor_thermal.c
processor_throttling.c
sbs.c
scan.c PNPACPI sets pnpdev->dev.archdata 2007-05-08 11:15:08 -07:00
system.c
tables.c
thermal.c ACPI: gracefully print null trip-point device 2007-06-18 00:40:51 -04:00
toshiba_acpi.c toshiba_acpi: fix section mismatch in allyesconfig 2007-06-16 13:16:15 -07:00
utils.c
video.c