[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DU0PR04MB9417AC0DD29F7610DE794C0688629@DU0PR04MB9417.eurprd04.prod.outlook.com>
Date: Thu, 25 Nov 2021 00:27:40 +0000
From: Peng Fan <peng.fan@....com>
To: Dan Carpenter <dan.carpenter@...cle.com>,
Jassi Brar <jassisinghbrar@...il.com>
CC: Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
dl-linux-imx <linux-imx@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: RE: [PATCH] mailbox: imx: Fix an IS_ERR() vs NULL bug
> Subject: [PATCH] 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@...cle.com>
Reviewed-by: Peng Fan <peng.fan@....com>
> ---
> drivers/mailbox/imx-mailbox.c | 4 ++--
> 1 file 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)) {
> --
> 2.20.1
Powered by blists - more mailing lists