diff mbox

DSPBRIDGE: decrease message pending in case of timeout

Message ID 67059DBF19D7214F9C66BB0EA91BA90EC32E9FCC@dlee04.ent.ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Uribe de Leon, Armando June 21, 2010, 7:36 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/dsp/bridge/wmd/msg_sm.c b/drivers/dsp/bridge/wmd/msg_sm.c index b505c5e..d56b46b 100644
--- a/drivers/dsp/bridge/wmd/msg_sm.c
+++ b/drivers/dsp/bridge/wmd/msg_sm.c
@@ -446,12 +446,16 @@  int bridge_msg_put(struct msg_queue *msg_queue_obj,
 		syncs[1] = msg_queue_obj->sync_done;
 		status = sync_wait_on_multiple_events(syncs, 2, utimeout,
 						      &index);
-		if (DSP_FAILED(status))
-			goto func_end;
 		/* Enter critical section */
 		spin_lock_bh(&hmsg_mgr->msg_mgr_lock);
+		msg_queue_obj->io_msg_pend--;
+
+		if (DSP_FAILED(status)) {
+			spin_unlock_bh(&hmsg_mgr->msg_mgr_lock);
+			goto func_end;
+		}
+
 		if (msg_queue_obj->done) {
-			msg_queue_obj->io_msg_pend--;
 			/* Exit critical section */
 			spin_unlock_bh(&hmsg_mgr->msg_mgr_lock);
 			/*  Signal that we're not going to access msg_queue_obj @@ -484,7 +488,6 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj,