diff mbox

[SURV] Fix surveillance locking

Message ID 20150615103320.28296.88348.stgit@thinktux.in.ibm.com
State Accepted
Headers show

Commit Message

Ananth N Mavinakayanahalli June 15, 2015, 10:33 a.m. UTC
There is one instance of fsp_surv_state that is accessed without
the surveillance lock. Fix it.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
---
 hw/fsp/fsp-surveillance.c |    2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/hw/fsp/fsp-surveillance.c b/hw/fsp/fsp-surveillance.c
index b94eb1b..18b2afd 100644
--- a/hw/fsp/fsp-surveillance.c
+++ b/hw/fsp/fsp-surveillance.c
@@ -192,8 +192,10 @@  static bool fsp_surv_msg_rr(u32 cmd_sub_mod, struct fsp_msg *msg)
 	switch (cmd_sub_mod) {
 	case FSP_RESET_START:
 		printf("SURV: Disabling surveillance\n");
+		lock(&surv_lock);
 		fsp_surv_state = false;
 		fsp_surv_ack_pending = false;
+		unlock(&surv_lock);
 		return true;
 	case FSP_RELOAD_COMPLETE:
 		fsp_surv_query();