v2 [patch 1/1] Do not unregister_cpu_notifier in case of wrong state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Heinz Graalfs <graalfs@xxxxxxxxxxxxxxxxxx>

This patch avoids calling unregister_cpu_notifier() in case
hwsampler_shutdown() is invoked in wrong state. 
---
 arch/s390/oprofile/hwsampler.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Index: 2.6.39/arch/s390/oprofile/hwsampler.c
===================================================================
--- 2.6.39.orig/arch/s390/oprofile/hwsampler.c
+++ 2.6.39/arch/s390/oprofile/hwsampler.c
@@ -1142,12 +1142,15 @@ int hwsampler_shutdown()
 		}
 
 		unregister_external_interrupt(0x1407, hws_ext_handler);
-		hws_state = HWS_INIT;
+		hws_state = 0;
+
+		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;
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux