public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ia64/topology.c: exit cache_add_dev when kobject_init_and_add fails
@ 2009-07-24  9:20 Xiaotian Feng
  2009-07-24 17:40 ` Fenghua Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Xiaotian Feng @ 2009-07-24  9:20 UTC (permalink / raw)
  To: tony.luck, fenghua.yu; +Cc: linux-ia64, linux-kernel, Xiaotian Feng

make cache_add_dev exit sysfs when kobject_init_and_add returns an
error.

Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
---
 arch/ia64/kernel/topology.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index bc80dff..82c5a8f 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -372,6 +372,10 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
 	retval = kobject_init_and_add(&all_cpu_cache_info[cpu].kobj,
 				      &cache_ktype_percpu_entry, &sys_dev->kobj,
 				      "%s", "cache");
+	if (retval < 0) {
+		cpu_cache_sysfs_exit(cpu);
+		return retval;
+	}
 
 	for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++) {
 		this_object = LEAF_KOBJECT_PTR(cpu,i);
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-24 17:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-24  9:20 [PATCH] ia64/topology.c: exit cache_add_dev when kobject_init_and_add fails Xiaotian Feng
2009-07-24 17:40 ` Fenghua Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox