@@ -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,