linux/drivers
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
..
acorn/char unicode diacritics support 2007-10-17 08:42:52 -07:00
acpi Fix Oops in toshiba_acpi error return path 2007-11-14 18:45:36 -08:00
amba
ata libata: Don't fail device revalidation for bad _GTF methods 2007-11-10 00:31:27 -05:00
atm Eliminate pointless casts from void* in a few driver irq handlers. 2007-10-23 19:53:16 -04:00
auxdisplay
base cleanup asm/scatterlist.h includes 2007-11-02 08:47:06 +01:00
block [NET]: Add the helper kernel_sock_shutdown() 2007-11-12 18:10:39 -08:00
bluetooth [Bluetooth] Add generic driver for Bluetooth USB devices 2007-10-22 02:59:46 -07:00
cdrom SG: audit of drivers that use blk_rq_map_sg() 2007-10-24 13:21:21 +02:00
char [TTY]: Fix network driver interactions with TCGET/SET calls. 2007-11-07 04:14:19 -08:00
clocksource
connector [CONNECTOR]: Fix a spurious kfree_skb() call 2007-10-30 21:29:47 -07:00
cpufreq
cpuidle cpuidle: remove unused exports 2007-10-29 17:27:50 -04:00
crypto [CRYPTO] users: Fix up scatterlist conversion errors 2007-10-27 00:52:07 -07:00
dca
dio
dma Remove bogus default y for DMAR and NET_DMA 2007-10-30 08:06:55 -07:00
edac NULL terminate the pci_device_ids in pasemi_edac 2007-10-19 11:53:56 -07:00
eisa
firewire firewire: fw-sbp2: fix refcounting 2007-11-07 01:59:28 +01:00
firmware define global BIT macro 2007-10-19 11:53:42 -07:00
hid HID: Don't access input_dev->private directly 2007-10-31 13:30:35 +01:00
hwmon hwmon: (i5k_amb) Convert macros to C functions 2007-11-08 08:42:47 -05:00
i2c typo fixes 2007-10-20 01:34:40 +02:00
ide ide: remove stale/incorrect comment from setup-pci.c 2007-11-13 22:09:16 +01:00
ieee1394 ieee1394: iso and async streams: s/g list fix 2007-11-04 14:31:16 +01:00
infiniband Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2007-10-30 15:26:56 -07:00
input Use i8253.c lock for PC speaker on MIPS, too. 2007-11-02 19:39:18 -07:00
isdn i4l: errors with assignments in if 2007-11-05 15:12:31 -08:00
kvm KVM: SVM: Intercept the 'invd' and 'wbinvd' instructions 2007-11-08 12:05:45 +02:00
leds leds: bugfixes for leds-gpio 2007-11-05 21:54:41 +00:00
lguest virtio: Force use of power-of-two for descriptor ring sizes 2007-11-12 13:59:40 +11:00
macintosh [POWERPC] windfarm: Fix windfarm thread freezer interaction 2007-11-08 14:15:34 +11:00
mca
md Add UNPLUG traces to all appropriate places 2007-11-09 13:41:32 +01:00
media V4L/DVB (6548): pvrusb2: Fix oops on module removal 2007-11-04 21:41:30 -02:00
message i2o: debug messages corrected 2007-11-05 15:12:31 -08:00
mfd typo fixes 2007-10-20 01:34:40 +02:00
misc fujitsu-laptop.c: remove dead code 2007-10-25 17:43:46 -04:00
mmc Add missing "\n" to log message 2007-11-10 11:59:49 +01:00
mtd Eliminate pointless casts from void* in a few driver irq handlers. 2007-10-23 19:53:16 -04:00
net [NET]: Move unneeded data to initdata section. 2007-11-13 03:23:50 -08:00
nubus
of [SPARC/64]: Consolidate of_register_driver 2007-10-17 21:17:42 -07:00
oprofile
parisc parisc: fix sg_page() fallout 2007-10-23 09:49:31 +02:00
parport [PARPORT] Remove unused 'irq' argument from parport irq functions 2007-10-23 19:53:16 -04:00
pci PCI: Add Kconfig option to disable deprecated pci_find_* API 2007-11-05 13:35:17 -08:00
pcmcia remove asm/bitops.h includes 2007-10-19 11:53:41 -07:00
pnp PNP: add debug message for adding new device 2007-10-17 08:43:04 -07:00
power Merge git://git.infradead.org/battery-2.6 2007-10-22 19:20:52 -07:00
ps3 remove asm/bitops.h includes 2007-10-19 11:53:41 -07:00
rapidio
rtc rtc: rtc-sh: Zero out tm value for invalid rtc states. 2007-11-07 20:13:24 +09:00
s390 [S390] Fix priority mistakes in drivers/s390/cio/cmf.c 2007-11-05 11:10:17 +01:00
sbus vfc_dev conversion to mutex: fallout 2007-10-20 15:04:06 -07:00
scsi PCI: Add Kconfig option to disable deprecated pci_find_* API 2007-11-05 13:35:17 -08:00
serial Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6 2007-11-09 15:25:29 -08:00
sh superhyway: Handle device_register() retval properly. 2007-11-07 11:13:55 +09:00
sn
spi fix abuses of ptrdiff_t 2007-10-29 07:41:33 -07:00
ssb ssb: Fix PCMCIA-host lowlevel bus access 2007-11-10 22:01:53 -08:00
tc lk201: remove obsolete driver 2007-10-17 08:42:57 -07:00
telephony telephony: phonedev panics if unregistering device not registered [Bug 9266] 2007-11-05 15:12:33 -08:00
uio
usb cleanup asm/scatterlist.h includes 2007-11-02 08:47:06 +01:00
video [ARM] 4645/1: Cyberpro: Trivial fix to restore 16bpp mode. 2007-11-08 23:29:36 +00:00
virtio virtio: Force use of power-of-two for descriptor ring sizes 2007-11-12 13:59:40 +11:00
w1 Kbuild/doc: fix links to Documentation files 2007-10-30 14:26:30 -07:00
watchdog Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog 2007-11-02 19:36:26 -07:00
xen Add missing newlines to some uses of dev_<level> messages 2007-10-18 14:37:28 -07:00
zorro Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
Kconfig Virtio interface 2007-10-23 15:49:54 +10:00
Makefile Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2007-10-23 16:37:29 -07:00