* [PATCH -next] [media] v4l: ti-vpe: fix return value check in vpe_probe()
@ 2013-10-30 3:15 Wei Yongjun
2013-11-05 5:23 ` Archit Taneja
2013-11-05 5:23 ` Archit Taneja
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2013-10-30 3:15 UTC (permalink / raw)
To: m.chehab, grant.likely, rob.herring, archit, hans.verkuil, k.debski
Cc: yongjun_wei, linux-media
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
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>
---
drivers/media/platform/ti-vpe/vpe.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
index 4e58069..90cf369 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;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] [media] v4l: ti-vpe: fix return value check in vpe_probe()
2013-10-30 3:15 [PATCH -next] [media] v4l: ti-vpe: fix return value check in vpe_probe() Wei Yongjun
@ 2013-11-05 5:23 ` Archit Taneja
2013-11-05 5:23 ` Archit Taneja
1 sibling, 0 replies; 3+ messages in thread
From: Archit Taneja @ 2013-11-05 5:23 UTC (permalink / raw)
To: Wei Yongjun, m.chehab, grant.likely, rob.herring, hans.verkuil, k.debski
Cc: yongjun_wei, linux-media
On Wednesday 30 October 2013 08:45 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> 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.
Reviewed-by: Archit Taneja <archit@ti.com>
Thanks,
Archit
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
> drivers/media/platform/ti-vpe/vpe.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
> index 4e58069..90cf369 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;
> }
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] [media] v4l: ti-vpe: fix return value check in vpe_probe()
2013-10-30 3:15 [PATCH -next] [media] v4l: ti-vpe: fix return value check in vpe_probe() Wei Yongjun
2013-11-05 5:23 ` Archit Taneja
@ 2013-11-05 5:23 ` Archit Taneja
1 sibling, 0 replies; 3+ messages in thread
From: Archit Taneja @ 2013-11-05 5:23 UTC (permalink / raw)
To: Wei Yongjun, m.chehab, grant.likely, rob.herring, hans.verkuil, k.debski
Cc: yongjun_wei, linux-media
On Wednesday 30 October 2013 08:45 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> 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.
Reviewed-by: Archit Taneja <archit@ti.com>
Thanks,
Archit
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
> drivers/media/platform/ti-vpe/vpe.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c
> index 4e58069..90cf369 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;
> }
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-05 5:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-30 3:15 [PATCH -next] [media] v4l: ti-vpe: fix return value check in vpe_probe() Wei Yongjun
2013-11-05 5:23 ` Archit Taneja
2013-11-05 5:23 ` Archit Taneja
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).