]> err.no Git - linux-2.6/commit
power: fix incorrect unregistration in power_supply_create_attrs error path
authorAndres Salomon <dilinger@queued.net>
Wed, 12 Dec 2007 19:12:59 +0000 (14:12 -0500)
committerAnton Vorontsov <cbouatmailru@gmail.com>
Fri, 1 Feb 2008 23:42:59 +0000 (02:42 +0300)
commit839dc9f105c0d856f9a0be48fb3bd0982ff5df5b
treea16cad00b33e82d3a11b186806eb9590b69ddaca
parent8efe444038a205e79b38b7ad03878824901849a8
power: fix incorrect unregistration in power_supply_create_attrs error path

In power_supply_create_attrs(), we create static attributes as referenced
by power_supply_static_attrs[i].  After that, if we fail, we unregister
via power_supply_static_attrs[psy->properties[i]].  This is incorrect, as
psy->properties has absolutely no bearing on static attribs.  This patch
fixes it to unregister the correct attrib.

Another line which was unnecessarily line wrapped is also unwrapped.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/power/power_supply_sysfs.c