Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mailbox: imx: Fix an IS_ERR() vs NULL bug

The devm_kzalloc() function does not return error pointers, it returns
NULL on failure.

Fixes: 97961f78e8bc ("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>

authored by

Dan Carpenter and committed by
Jassi Brar
05d06f37 79daec8b

+2 -2
+2 -2
drivers/mailbox/imx-mailbox.c
··· 563 563 size = sizeof(struct imx_sc_rpc_msg_max); 564 564 565 565 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; 568 568 569 569 priv->clk = devm_clk_get(dev, NULL); 570 570 if (IS_ERR(priv->clk)) {