Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=38ff4ffc039ba5a5878f2dcbb03d87c3a1f02f1b
Commit:     38ff4ffc039ba5a5878f2dcbb03d87c3a1f02f1b
Parent:     de5603748af8bf7deac403e6ba92887f8d18e812
Author:     Kristen Carlson Accardi <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 15:04:24 2007 -0700
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Thu May 10 03:30:37 2007 -0400

    ACPI: dock: cleanup the uid patch
    
    Make uid sysfs file error path free memory, and cleanup sysfs file
    when removing driver.  Also fix CodingStyle violations.
    
    Signed-off-by:  Kristen Carlson Accardi <[EMAIL PROTECTED]>
    Cc: Illya A. Volynets-Evenbakh <[EMAIL PROTECTED]>
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/acpi/dock.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 4546bf8..9ddc3f1 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -675,16 +675,15 @@ static ssize_t show_dock_uid(struct device *dev,
                             struct device_attribute *attr, char *buf)
 {
        unsigned long lbuf;
-       acpi_status status = acpi_evaluate_integer(dock_station->handle, 
"_UID", NULL, &lbuf);
-       if(ACPI_FAILURE(status)) {
+       acpi_status status = acpi_evaluate_integer(dock_station->handle,
+                                       "_UID", NULL, &lbuf);
+       if (ACPI_FAILURE(status))
            return 0;
-       }
+
        return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf);
 }
 DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
 
-
-
 /**
  * dock_add - add a new dock station
  * @handle: the dock station handle
@@ -736,6 +735,8 @@ static int dock_add(acpi_handle handle)
        ret = device_create_file(&dock_device.dev, &dev_attr_uid);
        if (ret) {
                printk("Error %d adding sysfs file\n", ret);
+               device_remove_file(&dock_device.dev, &dev_attr_docked);
+               device_remove_file(&dock_device.dev, &dev_attr_undock);
                platform_device_unregister(&dock_device);
                kfree(dock_station);
                return ret;
@@ -775,6 +776,7 @@ dock_add_err:
 dock_add_err_unregister:
        device_remove_file(&dock_device.dev, &dev_attr_docked);
        device_remove_file(&dock_device.dev, &dev_attr_undock);
+       device_remove_file(&dock_device.dev, &dev_attr_uid);
        platform_device_unregister(&dock_device);
        kfree(dock_station);
        return ret;
@@ -806,6 +808,7 @@ static int dock_remove(void)
        /* cleanup sysfs */
        device_remove_file(&dock_device.dev, &dev_attr_docked);
        device_remove_file(&dock_device.dev, &dev_attr_undock);
+       device_remove_file(&dock_device.dev, &dev_attr_uid);
        platform_device_unregister(&dock_device);
 
        /* free dock station memory */
-
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