Skip to content

Commit 05d06f3

Browse files
Dan CarpenterJassiBrar
authored andcommitted
mailbox: imx: Fix an IS_ERR() vs NULL bug
The devm_kzalloc() function does not return error pointers, it returns NULL on failure. Fixes: 97961f7 ("mailbox: imx: support i.MX8ULP S4 MU") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent 79daec8 commit 05d06f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mailbox/imx-mailbox.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,8 @@ static int imx_mu_probe(struct platform_device *pdev)
563563
size = sizeof(struct imx_sc_rpc_msg_max);
564564

565565
priv->msg = devm_kzalloc(dev, size, GFP_KERNEL);
566-
if (IS_ERR(priv->msg))
567-
return PTR_ERR(priv->msg);
566+
if (!priv->msg)
567+
return -ENOMEM;
568568

569569
priv->clk = devm_clk_get(dev, NULL);
570570
if (IS_ERR(priv->clk)) {

0 commit comments

Comments
 (0)