Skip to content

Commit

Permalink
thermal: Fix error path in thermal_init()
Browse files Browse the repository at this point in the history
thermal_unregister_governors() and class_unregister() were being called in
the wrong order.

Fixes: 80a26a5 ("Thermal: build thermal governors into thermal_sys module")
Cc: stable@vger.kernel.org
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
  • Loading branch information
Luis Henriques authored and Zhang Rui committed Dec 8, 2014
1 parent b6cc772 commit 9d367e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/thermal/thermal_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1837,10 +1837,10 @@ static int __init thermal_init(void)

exit_netlink:
genetlink_exit();
unregister_governors:
thermal_unregister_governors();
unregister_class:
class_unregister(&thermal_class);
unregister_governors:
thermal_unregister_governors();
error:
idr_destroy(&thermal_tz_idr);
idr_destroy(&thermal_cdev_idr);
Expand Down

0 comments on commit 9d367e5

Please sign in to comment.