Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 193e3320 authored by Tony Truong's avatar Tony Truong Committed by Gerrit - the friendly Code Review server
Browse files

mhi: core: Fix race condition on poll_inbound



Fix race condition in mhi_poll_inbound which could leave the
bounce buffer list and TRE list out of sync.

Change-Id: I76c7de75256b59f8a0dff2a85af733c441761385
Signed-off-by: default avatarAndrei Danaila <adanaila@codeaurora.org>
Signed-off-by: default avatarTony Truong <truong@codeaurora.org>
parent 72d34170
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1499,7 +1499,7 @@ int mhi_poll_inbound(struct mhi_client_handle *client_handle,
	bb_ctxt = &mhi_dev_ctxt->chan_bb_list[chan];

	mutex_lock(chan_mutex);
	if (local_chan_ctxt->rp != local_chan_ctxt->ack_rp) {
	if (bb_ctxt->rp != bb_ctxt->ack_rp) {
		pending_trb = (struct mhi_tx_pkt *)(local_chan_ctxt->ack_rp);
		result->flags = pending_trb->info;
		bb = bb_ctxt->ack_rp;