From: Dan Carpenter Date: Wed, 24 Nov 2021 14:51:26 +0000 (+0300) Subject: mailbox: imx: Fix an IS_ERR() vs NULL bug X-Git-Tag: baikal/aarch64/sdk6.1~4884^2~9 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=f7662c3e71a32f01e7273131384af35373d3709b;p=kernel.git mailbox: imx: Fix an IS_ERR() vs NULL bug 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 Reviewed-by: Peng Fan Signed-off-by: Jassi Brar --- diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index ffe36a6bef9e0..544de2db64531 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -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)) {