tools/lib/thermal: fix thermal_sampling_exit()

Message ID 20230202102812.453357-1-vincent.guittot@linaro.org
State New
Headers
Series tools/lib/thermal: fix thermal_sampling_exit() |

Commit Message

Vincent Guittot Feb. 2, 2023, 10:28 a.m. UTC
  thermal_sampling_init() suscribes to THERMAL_GENL_SAMPLING_GROUP_NAME group
so thermal_sampling_exit() should unsubscribe from the same group.

Fixes: 47c4b0de080a ("tools/lib/thermal: Add a thermal library")
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
---
 tools/lib/thermal/sampling.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Daniel Lezcano Feb. 2, 2023, 3:56 p.m. UTC | #1
On 02/02/2023 11:28, Vincent Guittot wrote:
> thermal_sampling_init() suscribes to THERMAL_GENL_SAMPLING_GROUP_NAME group
> so thermal_sampling_exit() should unsubscribe from the same group.
> 
> Fixes: 47c4b0de080a ("tools/lib/thermal: Add a thermal library")
> Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> ---

Thanks for the fix, applied
  

Patch

diff --git a/tools/lib/thermal/sampling.c b/tools/lib/thermal/sampling.c
index ee818f4e9654..70577423a9f0 100644
--- a/tools/lib/thermal/sampling.c
+++ b/tools/lib/thermal/sampling.c
@@ -54,7 +54,7 @@  int thermal_sampling_fd(struct thermal_handler *th)
 thermal_error_t thermal_sampling_exit(struct thermal_handler *th)
 {
 	if (nl_unsubscribe_thermal(th->sk_sampling, th->cb_sampling,
-				   THERMAL_GENL_EVENT_GROUP_NAME))
+				   THERMAL_GENL_SAMPLING_GROUP_NAME))
 		return THERMAL_ERROR;
 
 	nl_thermal_disconnect(th->sk_sampling, th->cb_sampling);