Re: [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Acked-by: Vignesh Raghavendra <vigneshr@xxxxxx>

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;



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux