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>
This commit is contained in:
parent
0c7281c0fa
commit
f14413184b
1 changed files with 1 additions and 1 deletions
|
@ -553,9 +553,9 @@ static void eeepc_hwmon_exit(void)
|
||||||
hwmon = eeepc_hwmon_device;
|
hwmon = eeepc_hwmon_device;
|
||||||
if (!hwmon)
|
if (!hwmon)
|
||||||
return ;
|
return ;
|
||||||
hwmon_device_unregister(hwmon);
|
|
||||||
sysfs_remove_group(&hwmon->kobj,
|
sysfs_remove_group(&hwmon->kobj,
|
||||||
&hwmon_attribute_group);
|
&hwmon_attribute_group);
|
||||||
|
hwmon_device_unregister(hwmon);
|
||||||
eeepc_hwmon_device = NULL;
|
eeepc_hwmon_device = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue