aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/kobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index 9aed594bfcac..c033dc8fa9af 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -314,7 +314,7 @@ int kobject_rename(struct kobject * kobj, const char *new_name)
314/** 314/**
315 * kobject_move - move object to another parent 315 * kobject_move - move object to another parent
316 * @kobj: object in question. 316 * @kobj: object in question.
317 * @new_parent: object's new parent 317 * @new_parent: object's new parent (can be NULL)
318 */ 318 */
319 319
320int kobject_move(struct kobject *kobj, struct kobject *new_parent) 320int kobject_move(struct kobject *kobj, struct kobject *new_parent)
@@ -330,8 +330,8 @@ int kobject_move(struct kobject *kobj, struct kobject *new_parent)
330 return -EINVAL; 330 return -EINVAL;
331 new_parent = kobject_get(new_parent); 331 new_parent = kobject_get(new_parent);
332 if (!new_parent) { 332 if (!new_parent) {
333 error = -EINVAL; 333 if (kobj->kset)
334 goto out; 334 new_parent = kobject_get(&kobj->kset->kobj);
335 } 335 }
336 /* old object path */ 336 /* old object path */
337 devpath = kobject_get_path(kobj, GFP_KERNEL); 337 devpath = kobject_get_path(kobj, GFP_KERNEL);