Skip to content

Commit 00ee3a1

Browse files
lategoodbyeJassiBrar
authored andcommitted
mailbox: bcm2835: Fix of_xlate return value
The bcm2835-mailbox returns NULL instead of an error pointer, which could result in a NULL ptr dereference in mbox_request_channel. So fix this by returning a proper error pointer. Signed-off-by: Stefan Wahren <[email protected]> Fixes: 0bae6af ("mailbox: Enable BCM2835 mailbox support") Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent 61a2f6d commit 00ee3a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mailbox/bcm2835-mailbox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static struct mbox_chan *bcm2835_mbox_index_xlate(struct mbox_controller *mbox,
134134
const struct of_phandle_args *sp)
135135
{
136136
if (sp->args_count != 0)
137-
return NULL;
137+
return ERR_PTR(-EINVAL);
138138

139139
return &mbox->chans[0];
140140
}

0 commit comments

Comments
 (0)