Skip to content

Commit

Permalink
mailbox: handle empty message in tx_tick
Browse files Browse the repository at this point in the history
commit cb710ab upstream.

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 <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
Signed-off-by: Amit Pundir <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sudeep-holla authored and gregkh committed Aug 7, 2017
1 parent abe9090 commit 016a638
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 @@ -104,8 +104,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 016a638

Please sign in to comment.