Skip to content

Commit

Permalink
mailbox: imx: Fix an IS_ERR() vs NULL bug
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Dan Carpenter authored and JassiBrar committed Jan 12, 2022
1 parent 79daec8 commit 05d06f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mailbox/imx-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 05d06f3

Please sign in to comment.