Commit 58d1c9fd authored by Daniel Lezcano's avatar Daniel Lezcano Committed by Rafael J. Wysocki

thermal/core: Fix unregistering netlink at thermal init time

The thermal subsystem initialization miss an netlink unregistering
function in the error. Add it.
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 47e3f000
...@@ -1607,7 +1607,7 @@ static int __init thermal_init(void) ...@@ -1607,7 +1607,7 @@ static int __init thermal_init(void)
result = thermal_register_governors(); result = thermal_register_governors();
if (result) if (result)
goto error; goto unregister_netlink;
result = class_register(&thermal_class); result = class_register(&thermal_class);
if (result) if (result)
...@@ -1622,6 +1622,8 @@ static int __init thermal_init(void) ...@@ -1622,6 +1622,8 @@ static int __init thermal_init(void)
unregister_governors: unregister_governors:
thermal_unregister_governors(); thermal_unregister_governors();
unregister_netlink:
thermal_netlink_exit();
error: error:
ida_destroy(&thermal_tz_ida); ida_destroy(&thermal_tz_ida);
ida_destroy(&thermal_cdev_ida); ida_destroy(&thermal_cdev_ida);
......
...@@ -699,3 +699,8 @@ int __init thermal_netlink_init(void) ...@@ -699,3 +699,8 @@ int __init thermal_netlink_init(void)
{ {
return genl_register_family(&thermal_gnl_family); return genl_register_family(&thermal_gnl_family);
} }
void __init thermal_netlink_exit(void)
{
genl_unregister_family(&thermal_gnl_family);
}
...@@ -13,6 +13,7 @@ struct thermal_genl_cpu_caps { ...@@ -13,6 +13,7 @@ struct thermal_genl_cpu_caps {
/* Netlink notification function */ /* Netlink notification function */
#ifdef CONFIG_THERMAL_NETLINK #ifdef CONFIG_THERMAL_NETLINK
int __init thermal_netlink_init(void); int __init thermal_netlink_init(void);
void __init thermal_netlink_exit(void);
int thermal_notify_tz_create(int tz_id, const char *name); int thermal_notify_tz_create(int tz_id, const char *name);
int thermal_notify_tz_delete(int tz_id); int thermal_notify_tz_delete(int tz_id);
int thermal_notify_tz_enable(int tz_id); int thermal_notify_tz_enable(int tz_id);
...@@ -115,4 +116,6 @@ static inline int thermal_genl_cpu_capability_event(int count, struct thermal_ge ...@@ -115,4 +116,6 @@ static inline int thermal_genl_cpu_capability_event(int count, struct thermal_ge
return 0; return 0;
} }
static inline void __init thermal_netlink_exit(void) {}
#endif /* CONFIG_THERMAL_NETLINK */ #endif /* CONFIG_THERMAL_NETLINK */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment