Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mailbox: add sanity check for channel array

Fail gracefully if there is no channel array attached to the mailbox
controller. Otherwise the later dereference will cause an OOPS which
might not be seen because mailbox controllers might instantiate very
early. Remove the comment explaining the obvious while here.

Fixes: 2b6d83e2b8b7 ("mailbox: Introduce framework for mailbox")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>

authored by

Wolfram Sang and committed by
Jassi Brar
c1aad755 c02053a9

+1 -2
+1 -2
drivers/mailbox/mailbox.c
··· 526 526 { 527 527 int i, txdone; 528 528 529 - /* Sanity check */ 530 - if (!mbox || !mbox->dev || !mbox->ops || !mbox->num_chans) 529 + if (!mbox || !mbox->dev || !mbox->ops || !mbox->chans || !mbox->num_chans) 531 530 return -EINVAL; 532 531 533 532 if (mbox->txdone_irq)