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] [day] [month] [year] [list]
Date:	Wed, 24 Feb 2016 16:41:14 +0530
From:	Laxman Dewangan <ldewangan@...dia.com>
To:	<wsa@...-dreams.de>
CC:	<linux-i2c@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] i2c: core: add devm apis for i2c_new_dummy and i2c_unregister

Hi Wolfram,

On Monday 08 February 2016 06:57 PM, Laxman Dewangan wrote:
> Add device managed APIs for i2c_new_dummy() and
> i2c_unregister_device() so that it can be managed by
> device framework for freeing it.
>
> This helps on following:
> 1. Maintaining the resource allocation and deallocation
> 	i2c_dummy = i2c_new_dummy();
> 	devm_regmap_init_i2c(i2c_dummy, &regmap_config)
>
> 	On this case, the user of i2c_dummy which is
> 	devm_regmap_init_i2c() is managed allocation where
> 	i2c_new_dummy() is not.
> 	On Free path, we have
> 		i2c_unregister_device(i2c_dummy)
> 	and later, device framework release the regmap. In this
> 	case, client of i2c_dummy after the i2c_dummy.
>
> 	By using devm apis, the sequence can be maintain
> 		i2c_dummy = devm_i2c_new_dummy();
> 		devm_regmap_init_i2c(i2c_dummy, &regmap_config)
>
> 	and resource deallocation will be done in reverse order
> 	by device framework.
>
> 2. No need to release the i2c_client in error/remove path and hence
>     there is less code requirement.
>
> Signed-off-by: Laxman Dewangan <ldewangan@...dia.com>
>


Can you please review this?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ