Thread (2 messages) 2 messages, 2 authors, 2026-03-29

Re: [PATCH] mailbox: mtk-vcp-mailbox: Fix the return value in mtk_vcp_mbox_xlate()

From: Jassi Brar <jassisinghbrar@gmail.com>
Date: 2026-03-29 16:30:04
Also in: linux-mediatek, lkml

On Wed, Feb 25, 2026 at 10:33 AM Felix Gu [off-list ref] wrote:
quoted hunk ↗ jump to hunk
The return value of mtk_vcp_mbox_xlate() is checked by IS_ERR(), so
return NULL is incorrect and could lead to a NULL pointer dereference.

Fixes: b562abd95672 ("mailbox: mediatek: Add mtk-vcp-mailbox driver")
Signed-off-by: Felix Gu <redacted>
---
 drivers/mailbox/mtk-vcp-mailbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mailbox/mtk-vcp-mailbox.c b/drivers/mailbox/mtk-vcp-mailbox.c
index cedad575528f..1b291b8ea15a 100644
--- a/drivers/mailbox/mtk-vcp-mailbox.c
+++ b/drivers/mailbox/mtk-vcp-mailbox.c
@@ -50,7 +50,7 @@ static struct mbox_chan *mtk_vcp_mbox_xlate(struct mbox_controller *mbox,
                                            const struct of_phandle_args *sp)
 {
        if (sp->args_count)
-               return NULL;
+               return ERR_PTR(-EINVAL);

        return &mbox->chans[0];
 }
Applied to mailbox/for-next
Thanks
Jassi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help