lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51886E12.8070701@cn.fujitsu.com>
Date:	Tue, 07 May 2013 10:59:30 +0800
From:	Gu Zheng <guz.fnst@...fujitsu.com>
To:	Libo Chen <clbchenlibo.chen@...wei.com>
CC:	wsa@...-dreams.de, uclinux-dist-devel@...ckfin.uclinux.org,
	linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
	Li Zefan <lizefan@...wei.com>
Subject: Re: [PATCH 2/2] i2c: pxa: no need release_mem_region before request_mem_region
 successful

Hi libo,

On 05/06/2013 09:11 PM, Libo Chen wrote:

> 
> move release_mem_region above kfree(i2c) && below clk_put(i2c->clk)
> 
> Signed-off-by: Libo Chen <libo.chen@...wei.com>
> ---
>  drivers/i2c/busses/i2c-pxa.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
> index ea6d45d..3188cd0 100644
> --- a/drivers/i2c/busses/i2c-pxa.c
> +++ b/drivers/i2c/busses/i2c-pxa.c
> @@ -1129,7 +1129,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
>  	i2c->clk = clk_get(&dev->dev, NULL);
>  	if (IS_ERR(i2c->clk)) {
>  		ret = PTR_ERR(i2c->clk);
> -		goto eclk;
> +		goto emm;

The new tag 'emm' seems not suitable here, keep the original 'eclk' here, modify the upper 'eclk' tags instead:
...
	ret = i2c_pxa_probe_dt(dev, i2c, &i2c_type);
	if (ret > 0)
		ret = i2c_pxa_probe_pdata(dev, i2c, &i2c_type);
	if (ret < 0)
-		goto eclk;
+		goto etype;

	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
	irq = platform_get_irq(dev, 0);
	if (res == NULL || irq < 0) {
		ret = -ENODEV;
-		goto eclk;
+		goto edev;
	}

	if (!request_mem_region(res->start, resource_size(res), res->name)) {
		ret = -ENOMEM;
-		goto eclk;
+		goto emem;
	}
...

>  	}
> 
>  	i2c->reg_base = ioremap(res->start, resource_size(res));
> @@ -1206,10 +1206,11 @@ ereqirq:
>  	iounmap(i2c->reg_base);
>  eremap:
>  	clk_put(i2c->clk);
> +emm:
> +	release_mem_region(res->start, resource_size(res));
>  eclk:
>  	kfree(i2c);

   eclk:
	release_mem_region(res->start, resource_size(res));
   etype:
   edev:
   emem:
  	kfree(i2c);

>  emalloc:
> -	release_mem_region(res->start, resource_size(res));
>  	return ret;
>  }
> 

Thanks,
Gu

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ