]> Pileus Git - ~andy/linux/commitdiff
[media] v4l: ti-vpe: fix return value check in vpe_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 30 Oct 2013 03:15:13 +0000 (00:15 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 10 Dec 2013 08:36:21 +0000 (06:36 -0200)
In case of error, the function devm_kzalloc() and devm_ioremap()
returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return
value check should be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Archit Taneja <archit@ti.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/platform/ti-vpe/vpe.c

index 1a31c8585a1b35bf238ec2f367eca13a78c46799..f949ef57a54c749569be7a910e4e44a8449a7383 100644 (file)
@@ -1942,8 +1942,8 @@ static int vpe_probe(struct platform_device *pdev)
        int ret, irq, func;
 
        dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
-       if (IS_ERR(dev))
-               return PTR_ERR(dev);
+       if (!dev)
+               return -ENOMEM;
 
        spin_lock_init(&dev->lock);
 
@@ -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;
        }