summaryrefslogtreecommitdiffstats
path: root/drivers/mailbox
diff options
context:
space:
mode:
authorStefan Wahren <stefan.wahren@i2se.com>2018-05-26 12:24:00 +0200
committerJassi Brar <jaswinder.singh@linaro.org>2018-06-06 18:51:59 +0200
commit00ee3a13a91be0ac250b89873043a3d2508f1208 (patch)
treead3f45f4b2adf09230294f5255057f848c699343 /drivers/mailbox
parentmailbox: qcom: Add msm8998 hmss compatible (diff)
downloadlinux-00ee3a13a91be0ac250b89873043a3d2508f1208.tar.xz
linux-00ee3a13a91be0ac250b89873043a3d2508f1208.zip
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 <stefan.wahren@i2se.com> Fixes: 0bae6af6d704 ("mailbox: Enable BCM2835 mailbox support") Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers/mailbox')
-rw-r--r--drivers/mailbox/bcm2835-mailbox.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mailbox/bcm2835-mailbox.c b/drivers/mailbox/bcm2835-mailbox.c
index cfb4b4496dd9..e92bbc533821 100644
--- a/drivers/mailbox/bcm2835-mailbox.c
+++ b/drivers/mailbox/bcm2835-mailbox.c
@@ -134,7 +134,7 @@ static struct mbox_chan *bcm2835_mbox_index_xlate(struct mbox_controller *mbox,
const struct of_phandle_args *sp)
{
if (sp->args_count != 0)
- return NULL;
+ return ERR_PTR(-EINVAL);
return &mbox->chans[0];
}