Commit:     839dc9f105c0d856f9a0be48fb3bd0982ff5df5b
Parent:     8efe444038a205e79b38b7ad03878824901849a8
Author:     Andres Salomon <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 12 14:12:59 2007 -0500
Committer:  Anton Vorontsov <[EMAIL PROTECTED]>
CommitDate: Sat Feb 2 02:42:59 2008 +0300

    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 <[EMAIL PROTECTED]>
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
 drivers/power/power_supply_sysfs.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/power_supply_sysfs.c 
index 7a2163f..bab591b 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -155,8 +155,7 @@ dynamics_failed:
        while (i--)
-               device_remove_file(psy->dev,
-                          &power_supply_static_attrs[psy->properties[i]]);
+               device_remove_file(psy->dev, &power_supply_static_attrs[i]);
        return rc;
@@ -166,8 +165,7 @@ void power_supply_remove_attrs(struct power_supply *psy)
        int i;
        for (i = 0; i < ARRAY_SIZE(power_supply_static_attrs); i++)
-               device_remove_file(psy->dev,
-                           &power_supply_static_attrs[i]);
+               device_remove_file(psy->dev, &power_supply_static_attrs[i]);
        for (i = 0; i < psy->num_properties; i++)
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to