Skip to content

Commit ec0286d

Browse files
Dan CarpenterWilliam Breathitt Gray
authored andcommitted
counter: ti-ecap-capture: fix IS_ERR() vs NULL check
The devm_counter_alloc() function returns NULL on error. It doesn't return error pointers. Fixes: 4e2f42a ("counter: ti-ecap-capture: capture driver support for ECAP") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Julien Panis <[email protected]> Acked-by: Vignesh Raghavendra <[email protected]> Link: https://lore.kernel.org/r/Y0bUbZvfDJHBG9C6@kili/ Signed-off-by: William Breathitt Gray <[email protected]>
1 parent 472a148 commit ec0286d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/counter/ti-ecap-capture.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,8 @@ static int ecap_cnt_probe(struct platform_device *pdev)
480480
int ret;
481481

482482
counter_dev = devm_counter_alloc(dev, sizeof(*ecap_dev));
483-
if (IS_ERR(counter_dev))
484-
return PTR_ERR(counter_dev);
483+
if (!counter_dev)
484+
return -ENOMEM;
485485

486486
counter_dev->name = ECAP_DRV_NAME;
487487
counter_dev->parent = dev;

0 commit comments

Comments
 (0)