Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1605518
| From | Sudeep Holla <sudeep.holla@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/3] mailbox: handle empty message in tx_tick |
| Date | 2017-03-21 12:40 +0100 |
| Message-ID | <tnqiS-2Gb-25@gated-at.bofh.it> (permalink) |
| References | <tnqiR-2Gb-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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")
Cc: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
drivers/mailbox/mailbox.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 2ed7fa681ecb..5ef014241212 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)
/* 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)
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 1/3] mailbox: always wait in mbox_send_message for blocking Tx mode Sudeep Holla <sudeep.holla@arm.com> - 2017-03-21 12:40 +0100 [PATCH 2/3] mailbox: skip complete wait event if timer expired Sudeep Holla <sudeep.holla@arm.com> - 2017-03-21 12:40 +0100 [PATCH 3/3] mailbox: handle empty message in tx_tick Sudeep Holla <sudeep.holla@arm.com> - 2017-03-21 12:40 +0100
csiph-web