Re: [PATCH 2.6.10-rc1 4/5] driver-model: kobject_add() error path reference counting fix

From: Tejun Heo
Date: Thu Nov 04 2004 - 02:21:46 EST


df_04_kobject_add_ref_fix.patch

In kobject_add(), @kobj wasn't put'd properly on error path. This
patch fixes it.


Signed-off-by: Tejun Heo <tj@xxxxxxxxxxx>


Index: linux-export/lib/kobject.c
===================================================================
--- linux-export.orig/lib/kobject.c 2004-11-04 10:25:58.000000000 +0900
+++ linux-export/lib/kobject.c 2004-11-04 11:04:14.000000000 +0900
@@ -183,6 +183,7 @@ int kobject_add(struct kobject * kobj)
unlink(kobj);
if (parent)
kobject_put(parent);
+ kobject_put(kobj);
} else {
kobject_hotplug(kobj, KOBJ_ADD);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/