public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check
@ 2022-10-12 14:51 Dan Carpenter
  2022-10-12 15:43 ` Julien Panis
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2022-10-12 14:51 UTC (permalink / raw)
  To: Vignesh Raghavendra, Julien Panis
  Cc: William Breathitt Gray, Greg Kroah-Hartman, linux-iio, linux-omap,
	kernel-janitors

The devm_counter_alloc() function returns NULL on error.  It doesn't
return error pointers.

Fixes: 4e2f42aa00b6 ("counter: ti-ecap-capture: capture driver support for ECAP")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/counter/ti-ecap-capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-capture.c
index af10de30aba5..8104d02bb5a4 100644
--- a/drivers/counter/ti-ecap-capture.c
+++ b/drivers/counter/ti-ecap-capture.c
@@ -479,8 +479,8 @@ static int ecap_cnt_probe(struct platform_device *pdev)
 	int ret;
 
 	counter_dev = devm_counter_alloc(dev, sizeof(*ecap_dev));
-	if (IS_ERR(counter_dev))
-		return PTR_ERR(counter_dev);
+	if (!counter_dev)
+		return -ENOMEM;
 
 	counter_dev->name = ECAP_DRV_NAME;
 	counter_dev->parent = dev;
-- 
2.35.1


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

* Re: [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check
  2022-10-12 14:51 [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check Dan Carpenter
@ 2022-10-12 15:43 ` Julien Panis
  2022-10-12 16:27 ` Vignesh Raghavendra
  2022-10-13  0:50 ` William Breathitt Gray
  2 siblings, 0 replies; 4+ messages in thread
From: Julien Panis @ 2022-10-12 15:43 UTC (permalink / raw)
  To: Dan Carpenter, Vignesh Raghavendra
  Cc: William Breathitt Gray, Greg Kroah-Hartman, linux-iio, linux-omap,
	kernel-janitors

Reviewed-by: Julien Panis <jpanis@baylibre.com>

On 12/10/2022 16:51, Dan Carpenter wrote:
> The devm_counter_alloc() function returns NULL on error.  It doesn't
> return error pointers.
>
> Fixes: 4e2f42aa00b6 ("counter: ti-ecap-capture: capture driver support for ECAP")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>   drivers/counter/ti-ecap-capture.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-capture.c
> index af10de30aba5..8104d02bb5a4 100644
> --- a/drivers/counter/ti-ecap-capture.c
> +++ b/drivers/counter/ti-ecap-capture.c
> @@ -479,8 +479,8 @@ static int ecap_cnt_probe(struct platform_device *pdev)
>   	int ret;
>   
>   	counter_dev = devm_counter_alloc(dev, sizeof(*ecap_dev));
> -	if (IS_ERR(counter_dev))
> -		return PTR_ERR(counter_dev);
> +	if (!counter_dev)
> +		return -ENOMEM;
>   
>   	counter_dev->name = ECAP_DRV_NAME;
>   	counter_dev->parent = dev;


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

* Re: [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check
  2022-10-12 14:51 [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check Dan Carpenter
  2022-10-12 15:43 ` Julien Panis
@ 2022-10-12 16:27 ` Vignesh Raghavendra
  2022-10-13  0:50 ` William Breathitt Gray
  2 siblings, 0 replies; 4+ messages in thread
From: Vignesh Raghavendra @ 2022-10-12 16:27 UTC (permalink / raw)
  To: Dan Carpenter, Julien Panis
  Cc: William Breathitt Gray, Greg Kroah-Hartman, linux-iio, linux-omap,
	kernel-janitors

Hi,

On 12/10/22 8:21 pm, Dan Carpenter wrote:
> The devm_counter_alloc() function returns NULL on error.  It doesn't
> return error pointers.
> 
> Fixes: 4e2f42aa00b6 ("counter: ti-ecap-capture: capture driver support for ECAP")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Vignesh Raghavendra <vigneshr@ti.com>

Thanks for the fix!

> ---
>  drivers/counter/ti-ecap-capture.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-capture.c
> index af10de30aba5..8104d02bb5a4 100644
> --- a/drivers/counter/ti-ecap-capture.c
> +++ b/drivers/counter/ti-ecap-capture.c
> @@ -479,8 +479,8 @@ static int ecap_cnt_probe(struct platform_device *pdev)
>  	int ret;
>  
>  	counter_dev = devm_counter_alloc(dev, sizeof(*ecap_dev));
> -	if (IS_ERR(counter_dev))
> -		return PTR_ERR(counter_dev);
> +	if (!counter_dev)
> +		return -ENOMEM;
>  
>  	counter_dev->name = ECAP_DRV_NAME;
>  	counter_dev->parent = dev;

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

* Re: [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check
  2022-10-12 14:51 [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check Dan Carpenter
  2022-10-12 15:43 ` Julien Panis
  2022-10-12 16:27 ` Vignesh Raghavendra
@ 2022-10-13  0:50 ` William Breathitt Gray
  2 siblings, 0 replies; 4+ messages in thread
From: William Breathitt Gray @ 2022-10-13  0:50 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Vignesh Raghavendra, Julien Panis, Greg Kroah-Hartman, linux-iio,
	linux-omap, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

On Wed, Oct 12, 2022 at 05:51:25PM +0300, Dan Carpenter wrote:
> The devm_counter_alloc() function returns NULL on error.  It doesn't
> return error pointers.
> 
> Fixes: 4e2f42aa00b6 ("counter: ti-ecap-capture: capture driver support for ECAP")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Queued for counter-fixes.

Thank you,

William Breathitt Gray

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2022-10-13 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-12 14:51 [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check Dan Carpenter
2022-10-12 15:43 ` Julien Panis
2022-10-12 16:27 ` Vignesh Raghavendra
2022-10-13  0:50 ` William Breathitt Gray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox