All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: armada: NULL vs IS_ERR() bug in probe
@ 2018-09-26 10:43 Dan Carpenter
  2018-09-26 12:09 ` Miquel Raynal
  2018-09-26 12:28 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-09-26 10:43 UTC (permalink / raw)
  To: kernel-janitors

The platform_get_resource() function doesn't return error pointers, it
returns NULL on error.

Fixes: 3d4e51844a4e ("thermal: armada: convert driver to syscon register accesses")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index 2c2f6d93034e..ebfe7c9a5a7a 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -526,8 +526,8 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev,
 
 	/* First memory region points towards the status register */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (IS_ERR(res))
-		return PTR_ERR(res);
+	if (!res)
+		return -ENODEV;
 
 	/*
 	 * Edit the resource start address and length to map over all the

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

* Re: [PATCH] thermal: armada: NULL vs IS_ERR() bug in probe
  2018-09-26 10:43 [PATCH] thermal: armada: NULL vs IS_ERR() bug in probe Dan Carpenter
@ 2018-09-26 12:09 ` Miquel Raynal
  2018-09-26 12:28 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2018-09-26 12:09 UTC (permalink / raw)
  To: kernel-janitors

Hi Dan,

Dan Carpenter <dan.carpenter@oracle.com> wrote on Wed, 26 Sep 2018
13:43:36 +0300:

> The platform_get_resource() function doesn't return error pointers, it
> returns NULL on error.
> 
> Fixes: 3d4e51844a4e ("thermal: armada: convert driver to syscon register accesses")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
> index 2c2f6d93034e..ebfe7c9a5a7a 100644
> --- a/drivers/thermal/armada_thermal.c
> +++ b/drivers/thermal/armada_thermal.c
> @@ -526,8 +526,8 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev,
>  
>  	/* First memory region points towards the status register */
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (IS_ERR(res))
> -		return PTR_ERR(res);
> +	if (!res)
> +		return -ENODEV;
>  
>  	/*
>  	 * Edit the resource start address and length to map over all the


I already sent my

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

for this patch, and it looks like the title changed so it's a v2, right?


Regards,
Miquèl

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

* Re: [PATCH] thermal: armada: NULL vs IS_ERR() bug in probe
  2018-09-26 10:43 [PATCH] thermal: armada: NULL vs IS_ERR() bug in probe Dan Carpenter
  2018-09-26 12:09 ` Miquel Raynal
@ 2018-09-26 12:28 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-09-26 12:28 UTC (permalink / raw)
  To: kernel-janitors

On Wed, Sep 26, 2018 at 02:09:02PM +0200, Miquel Raynal wrote:
> Hi Dan,
> 
> Dan Carpenter <dan.carpenter@oracle.com> wrote on Wed, 26 Sep 2018
> 13:43:36 +0300:
> 
> > The platform_get_resource() function doesn't return error pointers, it
> > returns NULL on error.
> > 
> > Fixes: 3d4e51844a4e ("thermal: armada: convert driver to syscon register accesses")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
> > index 2c2f6d93034e..ebfe7c9a5a7a 100644
> > --- a/drivers/thermal/armada_thermal.c
> > +++ b/drivers/thermal/armada_thermal.c
> > @@ -526,8 +526,8 @@ static int armada_thermal_probe_legacy(struct platform_device *pdev,
> >  
> >  	/* First memory region points towards the status register */
> >  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > -	if (IS_ERR(res))
> > -		return PTR_ERR(res);
> > +	if (!res)
> > +		return -ENODEV;
> >  
> >  	/*
> >  	 * Edit the resource start address and length to map over all the
> 
> 
> I already sent my
> 
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> 
> for this patch, and it looks like the title changed so it's a v2, right?

Ooops.  I'm sorry, I switched dev boxes and so I accidentally re-wrote
this patch.  My bad.  Sorry for the noise.

regards,
dan carpenter

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

end of thread, other threads:[~2018-09-26 12:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26 10:43 [PATCH] thermal: armada: NULL vs IS_ERR() bug in probe Dan Carpenter
2018-09-26 12:09 ` Miquel Raynal
2018-09-26 12:28 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.