diff options
author | Sudeep Holla <sudeep.holla@arm.com> | 2017-03-21 11:30:16 +0000 |
---|---|---|
committer | Sasha Levin <alexander.levin@verizon.com> | 2017-09-10 16:35:49 -0400 |
commit | 98b946e27788df95847b0bdf88595a63f4de5a1d (patch) | |
tree | c24e96b06c5a4b40cb64f2f0d6cc225467295f03 /drivers/mailbox/mailbox.c | |
parent | 4dba76fe6a694b95f937e9be1717335de48650c3 (diff) |
mailbox: handle empty message in tx_tick
[ Upstream commit cb710ab1d8a23f68ff8f45aedf3e552bb90e70de ]
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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'drivers/mailbox/mailbox.c')
-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 199d4cdc0ed5..ac6087f77e08 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -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) |