Commit ec0286dc authored by Dan Carpenter's avatar Dan Carpenter Committed by William Breathitt Gray

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: 4e2f42aa ("counter: ti-ecap-capture: capture driver support for ECAP")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarJulien Panis <jpanis@baylibre.com>
Acked-by: default avatarVignesh Raghavendra <vigneshr@ti.com>
Link: https://lore.kernel.org/r/Y0bUbZvfDJHBG9C6@kili/Signed-off-by: default avatarWilliam Breathitt Gray <william.gray@linaro.org>
parent 472a1482
......@@ -480,8 +480,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment