]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
committerJassi Brar <jaswinder.singh@linaro.org>
Sat, 30 May 2020 21:07:51 +0000 (16:07 -0500)
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>
drivers/mailbox/imx-mailbox.c

index 97bf0acf51d8c7897eb57f18d03d0e6068143154..cacc60662f24c0d3952b0cb3735c876827ad36ac 100644 (file)
@@ -378,7 +378,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) {