From 202c3d015f680d16d22e274e6f8478a75a556b4d Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Wed, 5 Dec 2007 13:49:31 +1100 Subject: [PATCH] --- yaml --- r: 81084 b: refs/heads/master c: 1e7710390f95b7efb3f74fd2f8b5fc28656b458c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/powerpc/platforms/cell/spu_base.c | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index f20b0b5cd1a0..c70374922e3f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 684bd614015188561197342fd336292e9e2ce196 +refs/heads/master: 1e7710390f95b7efb3f74fd2f8b5fc28656b458c diff --git a/trunk/arch/powerpc/platforms/cell/spu_base.c b/trunk/arch/powerpc/platforms/cell/spu_base.c index ee37e0e39b6b..f73263ba9841 100644 --- a/trunk/arch/powerpc/platforms/cell/spu_base.c +++ b/trunk/arch/powerpc/platforms/cell/spu_base.c @@ -574,13 +574,27 @@ EXPORT_SYMBOL_GPL(spu_add_sysdev_attr); int spu_add_sysdev_attr_group(struct attribute_group *attrs) { struct spu *spu; + int rc = 0; mutex_lock(&spu_full_list_mutex); - list_for_each_entry(spu, &spu_full_list, full_list) - sysfs_create_group(&spu->sysdev.kobj, attrs); + list_for_each_entry(spu, &spu_full_list, full_list) { + rc = sysfs_create_group(&spu->sysdev.kobj, attrs); + + /* we're in trouble here, but try unwinding anyway */ + if (rc) { + printk(KERN_ERR "%s: can't create sysfs group '%s'\n", + __func__, attrs->name); + + list_for_each_entry_continue_reverse(spu, + &spu_full_list, full_list) + sysfs_remove_group(&spu->sysdev.kobj, attrs); + break; + } + } + mutex_unlock(&spu_full_list_mutex); - return 0; + return rc; } EXPORT_SYMBOL_GPL(spu_add_sysdev_attr_group);