mailbox: mtk-vcp-mailbox: Fix the return value in mtk_vcp_mbox_xlate()

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: b562abd956 ("mailbox: mediatek: Add mtk-vcp-mailbox driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
This commit is contained in:
Felix Gu 2026-02-26 00:33:24 +08:00 committed by Jassi Brar
parent df1de2abf9
commit 1e0ec9719f

View 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];
}