]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mailbox: mtk-vcp-mailbox: Fix the return value in mtk_vcp_mbox_xlate()
authorFelix Gu <ustc.gu@gmail.com>
Wed, 25 Feb 2026 16:33:24 +0000 (00:33 +0800)
committerJassi Brar <jassisinghbrar@gmail.com>
Sun, 29 Mar 2026 15:50:50 +0000 (10:50 -0500)
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 <ustc.gu@gmail.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
drivers/mailbox/mtk-vcp-mailbox.c

index cedad575528fb49bca1b2233c61eba178e78da82..1b291b8ea15ac0629d2176b4552b17c5de0f2d09 100644 (file)
@@ -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];
 }