diff options
author | Pekka Paalanen <pq@iki.fi> | 2012-01-22 16:33:47 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-13 11:17:02 -0800 |
commit | ebb468b38e343782b3271343766d92978f8436a7 (patch) | |
tree | 94698f713a582ad2a428c860d3ca84599f3e4f09 /drivers | |
parent | d352f16e64cab162bb25e4f6af298f1a9d1d9e12 (diff) | |
download | kernel-common-ebb468b38e343782b3271343766d92978f8436a7.tar.gz kernel-common-ebb468b38e343782b3271343766d92978f8436a7.tar.bz2 kernel-common-ebb468b38e343782b3271343766d92978f8436a7.zip |
Staging: asus_oled: fix NULL-ptr crash on unloading
commit 3589e74595a4332ebf77b5ed006f3c6686071ecd upstream.
Asus_oled triggers the following bug on module unloading:
usbcore: deregistering interface driver asus-oled
BUG: unable to handle kernel NULL pointer dereference at 0000000000000038
IP: [<ffffffff8111292b>] sysfs_delete_link+0x30/0x66
Call Trace:
[<ffffffff81225373>] device_remove_class_symlinks+0x6b/0x70
[<ffffffff812256a8>] device_del+0x9f/0x1ab
[<ffffffff812257c5>] device_unregister+0x11/0x1e
[<ffffffffa000cb82>] asus_oled_disconnect+0x4f/0x9e [asus_oled]
[<ffffffff81277430>] usb_unbind_interface+0x54/0x103
[<ffffffff812276c4>] __device_release_driver+0xa2/0xeb
[<ffffffff81227794>] driver_detach+0x87/0xad
[<ffffffff812269e9>] bus_remove_driver+0x91/0xc1
[<ffffffff81227fb4>] driver_unregister+0x66/0x6e
[<ffffffff812771ed>] usb_deregister+0xbb/0xc4
[<ffffffffa000ce87>] asus_oled_exit+0x2f/0x31 [asus_oled]
[<ffffffff81068365>] sys_delete_module+0x1b8/0x21b
[<ffffffff810ae3de>] ? do_munmap+0x2ef/0x313
[<ffffffff813699bb>] system_call_fastpath+0x16/0x1b
This is due to an incorrect destruction sequence in asus_oled_exit().
Fix the order, fixes the bug. Tested on an Asus G50V laptop only.
Cc: Jakub Schmidtke <sjakub@gmail.com>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/asus_oled/asus_oled.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/asus_oled/asus_oled.c b/drivers/staging/asus_oled/asus_oled.c index 8894bd5f7d82..63bafbb0980f 100644 --- a/drivers/staging/asus_oled/asus_oled.c +++ b/drivers/staging/asus_oled/asus_oled.c @@ -811,10 +811,9 @@ error: static void __exit asus_oled_exit(void) { + usb_deregister(&oled_driver); class_remove_file(oled_class, &class_attr_version.attr); class_destroy(oled_class); - - usb_deregister(&oled_driver); } module_init(asus_oled_init); |