| From fe2b592173ff0274e70dc44d1d28c19bb995aa7c Mon Sep 17 00:00:00 2001 |
| From: Paul Bolle <pebolle@tiscali.nl> |
| Date: Fri, 31 Jul 2015 14:08:58 +0200 |
| Subject: windfarm: decrement client count when unregistering |
| |
| commit fe2b592173ff0274e70dc44d1d28c19bb995aa7c upstream. |
| |
| wf_unregister_client() increments the client count when a client |
| unregisters. That is obviously incorrect. Decrement that client count |
| instead. |
| |
| Fixes: 75722d3992f5 ("[PATCH] ppc64: Thermal control for SMU based machines") |
| |
| Signed-off-by: Paul Bolle <pebolle@tiscali.nl> |
| Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> |
| Signed-off-by: Zefan Li <lizefan@huawei.com> |
| --- |
| drivers/macintosh/windfarm_core.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| --- a/drivers/macintosh/windfarm_core.c |
| +++ b/drivers/macintosh/windfarm_core.c |
| @@ -421,7 +421,7 @@ int wf_unregister_client(struct notifier |
| { |
| mutex_lock(&wf_lock); |
| blocking_notifier_chain_unregister(&wf_client_list, nb); |
| - wf_client_count++; |
| + wf_client_count--; |
| if (wf_client_count == 0) |
| wf_stop_thread(); |
| mutex_unlock(&wf_lock); |