linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mailbox: imx: Fix an IS_ERR() vs NULL bug
@ 2021-11-24 14:51 Dan Carpenter
  2021-11-25  0:27 ` Peng Fan
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-11-24 14:51 UTC (permalink / raw)
  To: Jassi Brar, Peng Fan
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, linux-kernel, linux-arm-kernel, kernel-janitors

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>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] mailbox: imx: Fix an IS_ERR() vs NULL bug
  2021-11-24 14:51 [PATCH] mailbox: imx: Fix an IS_ERR() vs NULL bug Dan Carpenter
@ 2021-11-25  0:27 ` Peng Fan
  0 siblings, 0 replies; 2+ messages in thread
From: Peng Fan @ 2021-11-25  0:27 UTC (permalink / raw)
  To: Dan Carpenter, Jassi Brar
  Cc: Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	dl-linux-imx, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	kernel-janitors@vger.kernel.org

> 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@oracle.com>

Reviewed-by: Peng Fan <peng.fan@nxp.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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-25  0:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-24 14:51 [PATCH] mailbox: imx: Fix an IS_ERR() vs NULL bug Dan Carpenter
2021-11-25  0:27 ` Peng Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).