aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/eeepc-laptop.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg59@srcf.ucam.org>2008-08-20 17:08:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-20 18:40:30 -0400
commitf14413184b1de4dcbd5ec3e7c129c3ce2079f543 (patch)
treeaf063aad59d9cdb851a0549cd29d529c37a32863 /drivers/misc/eeepc-laptop.c
parent0c7281c0faa1d0bdbdc647430cbdf7e0aed7f385 (diff)
eeepc-laptop: fix use after free
eeepc-laptop uses the hwmon struct after unregistering the device, causing an oops on module unload. Flip the ordering to fix. Signed-off-by: Matthew Garrett <mjg@redhat.com> Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Corentin Chary <corentincj@iksaif.net> Cc: Karol Kozimor <sziwan@users.sourceforge.net> Cc: <stable@kernel.org> [2.6.26.x] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/eeepc-laptop.c')
-rw-r--r--drivers/misc/eeepc-laptop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/eeepc-laptop.c b/drivers/misc/eeepc-laptop.c
index 9e8d79e7e9f4..facdb9893c84 100644
--- a/drivers/misc/eeepc-laptop.c
+++ b/drivers/misc/eeepc-laptop.c
@@ -553,9 +553,9 @@ static void eeepc_hwmon_exit(void)
553 hwmon = eeepc_hwmon_device; 553 hwmon = eeepc_hwmon_device;
554 if (!hwmon) 554 if (!hwmon)
555 return ; 555 return ;
556 hwmon_device_unregister(hwmon);
557 sysfs_remove_group(&hwmon->kobj, 556 sysfs_remove_group(&hwmon->kobj,
558 &hwmon_attribute_group); 557 &hwmon_attribute_group);
558 hwmon_device_unregister(hwmon);
559 eeepc_hwmon_device = NULL; 559 eeepc_hwmon_device = NULL;
560} 560}
561 561