diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-10-29 23:15:13 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-12-10 03:36:21 -0500 |
commit | b68231a1b5e95a532f4d5135cdbd0fe6b0bfcb3b (patch) | |
tree | 4c2c0cb242a0a53eece03f5d50fa9d01367fb82d /drivers/media/platform/ti-vpe | |
parent | 6676cafe6bb69898cdb94937651249d0999e4b59 (diff) |
[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')
-rw-r--r-- | drivers/media/platform/ti-vpe/vpe.c | 8 |
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) | |||
1942 | int ret, irq, func; | 1942 | int ret, irq, func; |
1943 | 1943 | ||
1944 | dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); | 1944 | dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); |
1945 | if (IS_ERR(dev)) | 1945 | if (!dev) |
1946 | return PTR_ERR(dev); | 1946 | return -ENOMEM; |
1947 | 1947 | ||
1948 | spin_lock_init(&dev->lock); | 1948 | spin_lock_init(&dev->lock); |
1949 | 1949 | ||
@@ -1962,8 +1962,8 @@ static int vpe_probe(struct platform_device *pdev) | |||
1962 | * registers based on the sub block base addresses | 1962 | * registers based on the sub block base addresses |
1963 | */ | 1963 | */ |
1964 | dev->base = devm_ioremap(&pdev->dev, res->start, SZ_32K); | 1964 | dev->base = devm_ioremap(&pdev->dev, res->start, SZ_32K); |
1965 | if (IS_ERR(dev->base)) { | 1965 | if (!dev->base) { |
1966 | ret = PTR_ERR(dev->base); | 1966 | ret = -ENOMEM; |
1967 | goto v4l2_dev_unreg; | 1967 | goto v4l2_dev_unreg; |
1968 | } | 1968 | } |
1969 | 1969 | ||