[PATCH 03/10] Mailbox: Check valid registered callback before calling

Hiroshi DOYU Hiroshi.DOYU at nokia.com
Thu Jun 3 02:34:11 EDT 2010


From: Fernando Guzman Lugo <x0095840 at ti.com>

This patch checks if the mailbox user has assinged a valid
callback fuction before calling it.

Signed-off-by: Fernando Guzman Lugo <x0095840 at ti.com>
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU at nokia.com>
---
 arch/arm/plat-omap/mailbox.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 77c23f5..72efbe5 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -146,7 +146,8 @@ static void mbox_rx_work(struct work_struct *work)
 
 		msg = (mbox_msg_t)rq->special;
 		blk_end_request_all(rq, 0);
-		mbox->rxq->callback((void *)msg);
+		if (mbox->rxq->callback)
+			mbox->rxq->callback((void *)msg);
 	}
 }
 
-- 
1.7.1.rc1




More information about the linux-arm-kernel mailing list