summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/ti-vpe/vpe.c
diff options
context:
space:
mode:
authorWei Yongjun2013-10-30 04:15:13 +0100
committerMauro Carvalho Chehab2013-12-10 09:36:21 +0100
commitb68231a1b5e95a532f4d5135cdbd0fe6b0bfcb3b (patch)
tree4c2c0cb242a0a53eece03f5d50fa9d01367fb82d /drivers/media/platform/ti-vpe/vpe.c
parent[media] v4l: ti-vpe: fix error return code in vpe_probe() (diff)
downloadkernel-qcow2-linux-b68231a1b5e95a532f4d5135cdbd0fe6b0bfcb3b.tar.gz
kernel-qcow2-linux-b68231a1b5e95a532f4d5135cdbd0fe6b0bfcb3b.tar.xz
kernel-qcow2-linux-b68231a1b5e95a532f4d5135cdbd0fe6b0bfcb3b.zip
[media] v4l: ti-vpe: fix return value check in vpe_probe()
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>
Diffstat (limited to 'drivers/media/platform/ti-vpe/vpe.c')
-rw-r--r--drivers/media/platform/ti-vpe/vpe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
index 1a31c8585a1b..f949ef57a54c 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -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;
}