Skip to contentSkip to conversation

Do not unregister_cpu_notifier in case of wrong state

PATCH New Heinz Graalfs 1 participant 2 messages Mar 29, 2011 s390

lore
Share & tools
lore
#0 lore raw

cover Do not unregister_cpu_notifier in case of wrong state

From: Heinz Graalfs <[email protected]>

This patch avoids calling unregister_cpu_notifier() in case hwsampler_shutdown() is invoked in wrong state.

#1 lore raw

PATCH 1/1 Do not unregister_cpu_notifier in case of wrong state

From: Heinz Graalfs <[email protected]>

This patch avoids calling unregister_cpu_notifier() in case hwsampler_shutdown() is invoked in wrong state.

---
 arch/s390/oprofile/hwsampler.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
arch/s390/oprofile/hwsampler.c +6 -3
Index: 2.6.39/arch/s390/oprofile/hwsampler.c
===================================================================
@@ -1143,11 +1143,14 @@ int hwsampler_shutdown()
 
 		unregister_external_interrupt(0x1407, hws_ext_handler);
 		hws_state = HWS_INIT;
+
+		mutex_unlock(&hws_sem);
+		unregister_cpu_notifier(&hws_cpu_notifier);
+
 		rc = 0;
+	} else {
+		mutex_unlock(&hws_sem);
 	}
-	mutex_unlock(&hws_sem);
-
-	unregister_cpu_notifier(&hws_cpu_notifier);
 
 	return rc;
 }