Skip to content

Commit

Permalink
mailbox: handle empty message in tx_tick
Browse files Browse the repository at this point in the history
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: 2b6d83e ("mailbox: Introduce framework for mailbox")
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
  • Loading branch information
Sudeep Holla authored and Jassi Brar committed Apr 27, 2017
1 parent cc6eeaa commit cb710ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/mailbox/mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,11 @@ static void tx_tick(struct mbox_chan *chan, int r)
/* Submit next message */
msg_submit(chan);

if (!mssg)
return;

/* Notify the client */
if (mssg && chan->cl->tx_done)
if (chan->cl->tx_done)
chan->cl->tx_done(chan->cl, mssg, r);

if (r != -ETIME && chan->cl->tx_block)
Expand Down

0 comments on commit cb710ab

Please sign in to comment.