v4l: ti-vpe: checking for IS_ERR() instead of NULL
Subsystems (2)
PATCH 1/1 v4l: ti-vpe: checking for IS_ERR() instead of NULL
devm_ioremap() returns NULL on error, it doesn't return an ERR_PTR.
Signed-off-by Dan Carpenter <[email protected]>
drivers/media/platform/ti-vpe/vpe.c +2 -2
@@ -1962,8 +1962,8 @@ static int vpe_probe(struct platform_device *pdev)* registers based on the sub block base addresses */ dev->base =devm_ioremap (&pdev->dev, res->start,SZ_32K ); -if (IS_ERR (dev->base)) { - ret =PTR_ERR (dev->base); +if (!dev->base) { + ret = -ENOMEM ; goto v4l2_dev_unreg; }
Hi Dan,
Quoted 9 lines · Dan Carpenter
devm_ioremap()returns NULL on error, it doesn't return anERR_PTR.Signed-off-by Dan Carpenter <[email protected]>drivers/media/platform/ti-vpe/vpe.c +0
-0
drivers/media/platform/ti-vpe/vpe.c static int vpe_probe(struct platform_device *pdev) · line 1968
Quoted 9 lines
drivers/media/platform/ti-vpe/vpe.c +2
-2@@ -1962,8 +1962,8 @@ static int vpe_probe(struct platform_device *pdev)* registers based on the sub block base addresses */ dev->base =devm_ioremap (&pdev->dev, res->start,SZ_32K ); -if (IS_ERR (dev->base)) { - ret =PTR_ERR (dev->base); +if (!dev->base) { + ret = -ENOMEM ; goto v4l2_dev_unreg; }
Thanks for the patch, this was addressed in Wei's patch though:
"v4l: ti-vpe: fix return value check in vpe_probe()"
Thanks,
Archit