windfarm: decrement client count when unregistering
authorPaul Bolle <pebolle@tiscali.nl>
Fri, 31 Jul 2015 12:08:58 +0000 (14:08 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 6 Aug 2015 05:10:20 +0000 (15:10 +1000)
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>
drivers/macintosh/windfarm_core.c

index 3ee198b..cc7ece1 100644 (file)
@@ -435,7 +435,7 @@ int wf_unregister_client(struct notifier_block *nb)
 {
        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);