]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mailbox: imx: Fix an IS_ERR() vs NULL bug
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 24 Nov 2021 14:51:26 +0000 (17:51 +0300)
committerJassi Brar <jaswinder.singh@linaro.org>
Wed, 12 Jan 2022 05:47:32 +0000 (23:47 -0600)
The devm_kzalloc() function does not return error pointers, it returns
NULL on failure.

Fixes: 6619132eb8f0 ("mailbox: imx: support i.MX8ULP S4 MU")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/imx-mailbox.c

index ffe36a6bef9e05abe2a946a1430236320088084c..544de2db645313daced083bcc928aac217b5085b 100644 (file)
@@ -563,8 +563,8 @@ static int imx_mu_probe(struct platform_device *pdev)
                size = sizeof(struct imx_sc_rpc_msg_max);
 
        priv->msg = devm_kzalloc(dev, size, GFP_KERNEL);
-       if (IS_ERR(priv->msg))
-               return PTR_ERR(priv->msg);
+       if (!priv->msg)
+               return -ENOMEM;
 
        priv->clk = devm_clk_get(dev, NULL);
        if (IS_ERR(priv->clk)) {