diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-11-24 17:51:26 +0300 |
---|---|---|
committer | Jassi Brar <jaswinder.singh@linaro.org> | 2022-01-11 23:47:32 -0600 |
commit | 05d06f37196b2e3abeff2b98b785c8803865e646 (patch) | |
tree | e0f9b065a38189c4e168c5210a897efe1f1a9a16 | |
parent | 79daec8b9c02e04e2afb11eefa71698b913b2c55 (diff) |
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>
-rw-r--r-- | drivers/mailbox/imx-mailbox.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index ffe36a6bef9e..544de2db6453 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)) { |