]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
mailbox: imx: Fix return in imx_mu_scu_xlate()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 7 Apr 2020 09:27:53 +0000 (12:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:49:01 +0000 (17:49 +0200)
[ Upstream commit 1b3a347b7d56aa637157da1b7df225071af1421f ]

This called from mbox_request_channel().  The caller is  expecting error
pointers and not NULL so this "return NULL;" will lead to an Oops.

Fixes: 0a67003b1985 ("mailbox: imx: add SCU MU support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mailbox/imx-mailbox.c

index 7906624a731c122899c304904818748a61e60b91..9d6f0217077b22dd5e1eab060d30edd4edf571c7 100644 (file)
@@ -374,7 +374,7 @@ static struct mbox_chan *imx_mu_scu_xlate(struct mbox_controller *mbox,
                break;
        default:
                dev_err(mbox->dev, "Invalid chan type: %d\n", type);
-               return NULL;
+               return ERR_PTR(-EINVAL);
        }
 
        if (chan >= mbox->num_chans) {