diff options
author | Sudeep Holla <sudeep.holla@arm.com> | 2017-03-21 07:30:16 -0400 |
---|---|---|
committer | Jassi Brar <jaswinder.singh@linaro.org> | 2017-04-27 06:50:04 -0400 |
commit | cb710ab1d8a23f68ff8f45aedf3e552bb90e70de (patch) | |
tree | 59a9d521b0b01091fa77aa994f6c200a693250e9 | |
parent | cc6eeaa3029a6dbcb4ad41b1f92876483bd88965 (diff) |
mailbox: handle empty message in tx_tick
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: 2b6d83e2b8b7 ("mailbox: Introduce framework for mailbox")
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r-- | drivers/mailbox/mailbox.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index 49e5dadd5733..9dfbf7ea10a2 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c | |||
@@ -103,8 +103,11 @@ static void tx_tick(struct mbox_chan *chan, int r) | |||
103 | /* Submit next message */ | 103 | /* Submit next message */ |
104 | msg_submit(chan); | 104 | msg_submit(chan); |
105 | 105 | ||
106 | if (!mssg) | ||
107 | return; | ||
108 | |||
106 | /* Notify the client */ | 109 | /* Notify the client */ |
107 | if (mssg && chan->cl->tx_done) | 110 | if (chan->cl->tx_done) |
108 | chan->cl->tx_done(chan->cl, mssg, r); | 111 | chan->cl->tx_done(chan->cl, mssg, r); |
109 | 112 | ||
110 | if (r != -ETIME && chan->cl->tx_block) | 113 | if (r != -ETIME && chan->cl->tx_block) |