public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <archit@ti.com>
To: Wei Yongjun <weiyj.lk@gmail.com>, <m.chehab@samsung.com>,
	<grant.likely@linaro.org>, <rob.herring@calxeda.com>,
	<hans.verkuil@cisco.com>, <k.debski@samsung.com>
Cc: <yongjun_wei@trendmicro.com.cn>, <linux-media@vger.kernel.org>
Subject: Re: [PATCH -next] [media] v4l: ti-vpe: fix return value check in vpe_probe()
Date: Tue, 5 Nov 2013 10:53:51 +0530	[thread overview]
Message-ID: <527880E7.4070005@ti.com> (raw)
In-Reply-To: <CAPgLHd-YSAP+236AfZTXT3Cg_opQ+t=+nUHL+CVhXnkeA=zcBw@mail.gmail.com>

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;
>   	}
>
>
>


      parent reply	other threads:[~2013-11-05  5:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=527880E7.4070005@ti.com \
    --to=archit@ti.com \
    --cc=grant.likely@linaro.org \
    --cc=hans.verkuil@cisco.com \
    --cc=k.debski@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=rob.herring@calxeda.com \
    --cc=weiyj.lk@gmail.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox