linux/drivers/acpi
Andrey Borzenkov 1299342bac Fix Oops in toshiba_acpi error return path
When backlight_device_register() fails, return after undo initialization, do
not try to use pointer that just was reset to NULL

This fixes this oops:

[ 1595.177672]  [<c010480a>] show_trace_log_lvl+0x1a/0x30
[ 1595.177706]  [<c01052a2>] show_trace+0x12/0x20
[ 1595.177718]  [<c0105305>] dump_stack+0x15/0x20
[ 1595.177728]  [<c01c9375>] kobject_shadow_add+0x125/0x1c0
[ 1595.177754]  [<c01c941a>] kobject_add+0xa/0x10
[ 1595.177764]  [<c0239a37>] device_add+0x97/0x5d0
[ 1595.177776]  [<c0239f82>] device_register+0x12/0x20
[ 1595.177786]  [<dfd912df>] backlight_device_register+0x9f/0x110 [backlight]
[ 1595.177814]  [<df861117>] toshiba_acpi_init+0x117/0x15e [toshiba_acpi]
[ 1595.177834]  [<c013e28d>] sys_init_module+0xfd/0x14e0
[ 1595.177871]  [<c0104112>] sysenter_past_esp+0x5f/0x99
[ 1595.177883]  =======================
[ 1595.177890] Could not register toshiba backlight device
[ 1595.177985] BUG: unable to handle kernel NULL pointer dereference at virtual address 00000004
...
[ 1595.394097] EIP:    0060:[<df861143>]    Not tainted VLI
[ 1595.394101] EFLAGS: 00010282   (2.6.23-rc9-1avb #24)
[ 1595.480081] EIP is at toshiba_acpi_init+0x143/0x15e [toshiba_acpi]

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: John Belmonte <toshiba_acpi@memebeam.org>
Acked-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:36 -08:00
..
dispatcher ACPICA: Lindent 2007-05-09 23:34:35 -04:00
events ACPICA: hw: remove use_lock flag from acpi_hw_register_{read, write} 2007-10-10 01:00:26 -04:00
executer ACPICA: Lindent 2007-05-09 23:34:35 -04:00
hardware Pull acpica into test branch 2007-10-10 01:00:45 -04:00
namespace ACPI: Fix a warning of discarding qualifiers from pointer target type 2007-08-25 01:38:40 -04:00
parser ACPICA: Lindent 2007-05-09 23:34:35 -04:00
resources fix compilation with gcc 4.2 2007-08-11 15:47:42 -07:00
sleep Pull alexey-fixes into release branch 2007-10-29 17:30:21 -04:00
tables ACPI: suppress uninitialized var warning 2007-10-10 00:18:31 -04:00
utilities ACPI: add dump_stack() to trace acpi_format_exception programming errors 2007-08-25 01:39:02 -04:00
ac.c ACPI: AC: Add sysfs interface 2007-09-27 15:50:23 -04:00
acpi_memhotplug.c ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI drivers 2007-07-23 13:56:42 -04:00
asus_acpi.c ACPI: Schedule /proc/acpi/event for removal 2007-08-23 15:20:26 -04:00
battery.c ACPI: Battery: remove cycle from battery removal. 2007-11-13 09:02:18 -08:00
bay.c ACPI: bay: send envp with uevent - fix 2007-08-11 22:10:04 -04:00
blacklist.c ACPI: make blacklist more verbose 2007-03-09 21:19:05 -05:00
bus.c ACPI: Fan: Drop force_power_state acpi_device option 2007-10-25 16:31:31 -04:00
button.c ACPI: button: send initial lid state after add and resume 2007-10-25 16:31:30 -04:00
cm_sbs.c ACPI: clean up ACPI_MODULE_NAME() use 2007-02-12 22:42:12 -05:00
container.c ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI drivers 2007-07-23 13:56:42 -04:00
debug.c ACPI: clean up ACPI_MODULE_NAME() use 2007-02-12 22:42:12 -05:00
dock.c ACPI: dock: Send key=value pair instead of plain value 2007-08-11 22:12:10 -04:00
ec.c ACPI: EC: fix use-after-free 2007-10-25 16:38:02 -04:00
event.c ACPI: fix CONFIG_NET=n acpi_bus_generate_netlink_event build failure 2007-09-03 11:15:11 -04:00
fan.c ACPI: Fan: Drop force_power_state acpi_device option 2007-10-25 16:31:31 -04:00
glue.c ACPI: fix empty macros found by -Wextra 2007-07-22 00:54:24 -04:00
Kconfig ACPI: add documentation for deprecated /proc/acpi/battery in ACPI_PROCFS 2007-11-10 14:28:16 -08:00
Makefile ACPI: SBS: Split host controller (ACPI0001) from SBS driver (ACPI0002) 2007-09-27 15:50:22 -04:00
numa.c x86_64: fake pxm-to-node mapping for fake numa 2007-07-21 18:37:10 -07:00
osl.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2007-10-19 13:12:46 -07:00
pci_bind.c ACPI: clean up ACPI_MODULE_NAME() use 2007-02-12 22:42:12 -05:00
pci_irq.c ACPI: clean up ACPI_MODULE_NAME() use 2007-02-12 22:42:12 -05:00
pci_link.c ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI drivers 2007-07-23 13:56:42 -04:00
pci_root.c ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI drivers 2007-07-23 13:56:42 -04:00
power.c ACPI: power: don't cache power resource state 2007-10-25 16:31:31 -04:00
processor_core.c Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-x86 2007-10-19 15:06:00 -07:00
processor_idle.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2007-10-19 13:12:46 -07:00
processor_perflib.c acpi-cpufreq: Fix some x86/x86-64 acpi-cpufreq driver issues 2007-08-07 18:40:30 -04:00
processor_thermal.c ACPI: delete extra #defines in /drivers/acpi/ drivers 2007-02-12 23:50:52 -05:00
processor_throttling.c ACPI: quiet ACPI Exceptions due to no _PTC or _TSS 2007-07-25 00:57:46 -04:00
sbs.c ACPI: SBS: Add sysfs alarm 2007-09-27 15:50:23 -04:00
sbshc.c ACPI: SBS: Split host controller (ACPI0001) from SBS driver (ACPI0002) 2007-09-27 15:50:22 -04:00
sbshc.h ACPI: SBS: Split host controller (ACPI0001) from SBS driver (ACPI0002) 2007-09-27 15:50:22 -04:00
scan.c Driver core: change add_uevent_var to use a struct 2007-10-12 14:51:01 -07:00
system.c ACPI: Populate /sys/firmware/acpi/tables/ 2007-07-22 02:42:45 -04:00
tables.c Revert "ACPI: parse 2nd MADT by default" 2007-03-30 14:16:10 -04:00
thermal.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2007-10-19 13:12:46 -07:00
toshiba_acpi.c Fix Oops in toshiba_acpi error return path 2007-11-14 18:45:36 -08:00
utils.c ACPI: clean up ACPI_MODULE_NAME() use 2007-02-12 22:42:12 -05:00
video.c Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6 2007-10-19 13:12:46 -07:00