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]
Date:	Sat, 30 Mar 2013 09:11:54 +0100
From:	Lars-Peter Clausen <lars@...afoo.de>
To:	Jean Delvare <khali@...ux-fr.org>
CC:	Wolfram Sang <wsa@...-dreams.de>, Ben Dooks <ben-linux@...ff.org>,
	linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
	Guan Xuetao <gxt@...c.pku.edu.cn>,
	Mauro Carvalho Chehab <mchehab@...hat.com>,
	Ben Hutchings <bhutchings@...arflare.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Alan Cox <alan@...ux.intel.com>,
	Nicolas Ferre <nicolas.ferre@...el.com>,
	Aaro Koskinen <aaro.koskinen@....fi>,
	Shawn Guo <shawn.guo@...aro.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Lars Poeschel <poeschel@...onage.de>
Subject: Re: [PATCH 3/6] i2c: Ignore return value of i2c_del_adapter()

Hi Jean,

On 03/30/2013 08:55 AM, Jean Delvare wrote:
> Hi Lars-Peter,
> 
> On Sat,  9 Mar 2013 19:16:46 +0100, Lars-Peter Clausen wrote:
>> i2c_del_adapter() always returns 0.
> 
> I beg you pardon? i2c_del_adapter() starts with:
> 
> int i2c_del_adapter(struct i2c_adapter *adap)
> {
> 	int res = 0;
> 	struct i2c_adapter *found;
> 	struct i2c_client *client, *next;
> 
> 	/* First make sure that this adapter was ever added */
> 	mutex_lock(&core_lock);
> 	found = idr_find(&i2c_adapter_idr, adap->nr);
> 	mutex_unlock(&core_lock);
> 	if (found != adap) {
> 		pr_debug("i2c-core: attempting to delete unregistered "
> 			 "adapter [%s]\n", adap->name);
> 		return -EINVAL;
> 	}
> 
> 	/* Tell drivers about this removal */
> 	mutex_lock(&core_lock);
> 	res = bus_for_each_drv(&i2c_bus_type, NULL, adap,
> 			       __process_removed_adapter);
> 	mutex_unlock(&core_lock);
> 	if (res)
> 		return res;
> (...)
> 
> So, no, it doesn't "always return 0".
> 

Patch 1 and 2 in this series remove those two instances:
https://lkml.org/lkml/2013/3/9/72
https://lkml.org/lkml/2013/3/9/86

For an explanation why this should be done please take a look at the cover
letter to this patch series https://lkml.org/lkml/2013/3/9/73

- Lars
--
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