Mailbox: Check valid registered callback before calling

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

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
This commit is contained in:
Fernando Guzman Lugo 2010-01-27 20:04:02 -06:00 committed by Hiroshi DOYU
parent 0e828e8c2b
commit 9caae4d87c
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}
}