[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1203368213-30528-3-git-send-email-gcosta@redhat.com>
Date: Mon, 18 Feb 2008 17:56:52 -0300
From: Glauber Costa <gcosta@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org, andrew.grover@...el.com,
paul.s.diefenbaugh@...el.com, linux@...do.de,
anil.s.keshavamurthy@...el.com, lenb@...nel.org,
linux-acpi@...r.kernel.org, Glauber Costa <gcosta@...hat.com>
Subject: [PATCH 3/4] provide error handling for unclean objects
Previously, if acpi_processor_start() failed to
create sysfs nodes, it would leave stuff to be cleaned,
that won't perish in acpi_processor_remove(),
since we'll have pr->cdev == NULL.
This patch cleans those objects.
Signed-off-by: Glauber Costa <gcosta@...hat.com>
---
drivers/acpi/processor_core.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 5023410..06a230a 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -680,11 +680,12 @@ #endif
result = sysfs_create_link(&device->dev.kobj, &cdev->device.kobj,
"thermal_cooling");
if (result)
- return result;
+ goto err_thermal;
+
result = sysfs_create_link(&cdev->device.kobj, &device->dev.kobj,
"device");
if (result)
- return result;
+ goto err_sysfs;
pr->cdev = cdev;
@@ -694,9 +695,13 @@ #endif
printk(" %d throttling states", pr->throttling.state_count);
printk(")\n");
}
+ return result;
- end:
-
+err_sysfs:
+ sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
+err_thermal:
+ thermal_cooling_device_unregister(pr->cdev);
+end:
return result;
}
--
1.4.2
--
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