From: Dan Carpenter Date: Tue, 7 Apr 2020 09:27:53 +0000 (+0300) Subject: mailbox: imx: Fix return in imx_mu_scu_xlate() X-Git-Tag: v5.7.6~174 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1d2e5c9f8a4a2087155cd703f255e167232dbac;p=thirdparty%2Fkernel%2Fstable.git mailbox: imx: Fix return in imx_mu_scu_xlate() [ 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 Signed-off-by: Jassi Brar Signed-off-by: Sasha Levin --- diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 7906624a731c1..9d6f0217077b2 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -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) {