}
}
#endif
+ type->typ_kobj = kobject_create_and_add(type->typ_name, lustre_kobj);
+ if (!type->typ_kobj) {
+ rc = -ENOMEM;
+ GOTO(failed, rc);
+ }
+
if (ldt != NULL) {
type->typ_lu = ldt;
rc = lu_device_type_init(ldt);
RETURN (0);
failed:
+ if (type->typ_kobj)
+ kobject_put(type->typ_kobj);
if (type->typ_name != NULL) {
#ifdef CONFIG_PROC_FS
if (type->typ_procroot != NULL)
RETURN(-EBUSY);
}
+ if (type->typ_kobj)
+ kobject_put(type->typ_kobj);
+
/* we do not use type->typ_procroot as for compatibility purposes
* other modules can share names (i.e. lod can use lov entry). so
* we can't reference pointer as it can get invalided when another