Commit 98b946e2 authored by Sudeep Holla's avatar Sudeep Holla Committed by Sasha Levin

mailbox: handle empty message in tx_tick

[ Upstream commit cb710ab1 ]

We already check if the message is empty before calling the client
tx_done callback. Calling completion on a wait event is also invalid
if the message is empty.

This patch moves the existing empty message check earlier.

Fixes: 2b6d83e2 ("mailbox: Introduce framework for mailbox")
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent 4dba76fe
...@@ -104,8 +104,11 @@ static void tx_tick(struct mbox_chan *chan, int r) ...@@ -104,8 +104,11 @@ static void tx_tick(struct mbox_chan *chan, int r)
/* Submit next message */ /* Submit next message */
msg_submit(chan); msg_submit(chan);
if (!mssg)
return;
/* Notify the client */ /* Notify the client */
if (mssg && chan->cl->tx_done) if (chan->cl->tx_done)
chan->cl->tx_done(chan->cl, mssg, r); chan->cl->tx_done(chan->cl, mssg, r);
if (r != -ETIME && chan->cl->tx_block) if (r != -ETIME && chan->cl->tx_block)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment