All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mailbox: Avoid NULL-pointer dereference in mbox_chan_received_data()
@ 2014-10-30 20:01 ` Andrew Bresticker
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Bresticker @ 2014-10-30 20:01 UTC (permalink / raw)
  To: linux-arm-kernel

If a message has been received on a channel, but no client has yet bound
to it, mbox_chan_received_data() will dereference a NULL client pointer.
Check for the presence of a client first.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 drivers/mailbox/mailbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index afcb430..5008028 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -142,7 +142,7 @@ static void poll_txdone(unsigned long data)
 void mbox_chan_received_data(struct mbox_chan *chan, void *mssg)
 {
 	/* No buffering the received data */
-	if (chan->cl->rx_callback)
+	if (chan->cl && chan->cl->rx_callback)
 		chan->cl->rx_callback(chan->cl, mssg);
 }
 EXPORT_SYMBOL_GPL(mbox_chan_received_data);
-- 
2.1.0.rc2.206.gedb03e5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-11-08 18:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-30 20:01 [PATCH 1/2] mailbox: Avoid NULL-pointer dereference in mbox_chan_received_data() Andrew Bresticker
2014-10-30 20:01 ` Andrew Bresticker
2014-10-30 20:01 ` [PATCH 2/2] mailbox: Don't unnecessarily re-arm the polling timer Andrew Bresticker
2014-10-30 20:01   ` Andrew Bresticker
2014-10-31 11:41   ` Thierry Reding
2014-10-31 11:41     ` Thierry Reding
2014-11-08 18:21     ` Jassi Brar
2014-11-08 18:21       ` Jassi Brar
2014-10-31  4:01 ` [PATCH 1/2] mailbox: Avoid NULL-pointer dereference in mbox_chan_received_data() Jassi Brar
2014-10-31  4:01   ` Jassi Brar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.