Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6996abf0962bb86b6285987a4698f6d275ff531f
Commit:     6996abf0962bb86b6285987a4698f6d275ff531f
Parent:     548c343b2ff03488b913440799e83d66d7db8fad
Author:     Nicolas Boichat <[EMAIL PROTECTED]>
AuthorDate: Sun May 27 22:17:43 2007 +0200
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun May 27 22:17:43 2007 +0200

    hwmon/applesmc: Handle name file creation error and deletion
    
    The previous patch was incomplete.
    
    Signed-off-by: Nicolas Boichat <[EMAIL PROTECTED]>
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/hwmon/applesmc.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 366f4a1..fd1281f 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -1206,11 +1206,13 @@ static int __init applesmc_init(void)
        }
 
        ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_name.attr);
+       if (ret)
+               goto out_device;
 
        /* Create key enumeration sysfs files */
        ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group);
        if (ret)
-               goto out_device;
+               goto out_name;
 
        /* create fan files */
        count = applesmc_get_fan_count();
@@ -1310,6 +1312,8 @@ out_fan_1:
        sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]);
 out_key_enumeration:
        sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group);
+out_name:
+       sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr);
 out_device:
        platform_device_unregister(pdev);
 out_driver:
@@ -1335,6 +1339,7 @@ static void __exit applesmc_exit(void)
        sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]);
        sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]);
        sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group);
+       sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr);
        platform_device_unregister(pdev);
        platform_driver_unregister(&applesmc_driver);
        release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS);
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to