Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72925
b: refs/heads/master
c: 34358c2
h: refs/heads/master
i:
  72923: 2c049e9
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Oct 31, 2007
1 parent 8f69c4a commit 49e248c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fcd239d3d5575e5cc63aab5c33cf6dc66904f6d6
refs/heads/master: 34358c26a2c96b2a068dc44e0ac602106a466bce
13 changes: 13 additions & 0 deletions trunk/lib/kobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,19 @@ int kobject_rename(struct kobject * kobj, const char *new_name)
if (!kobj->parent)
return -EINVAL;

/* see if this name is already in use */
if (kobj->kset) {
struct kobject *temp_kobj;
temp_kobj = kset_find_obj(kobj->kset, new_name);
if (temp_kobj) {
printk(KERN_WARNING "kobject '%s' can not be renamed "
"to '%s' as '%s' is already in existance.\n",
kobject_name(kobj), new_name, new_name);
kobject_put(temp_kobj);
return -EINVAL;
}
}

devpath = kobject_get_path(kobj, GFP_KERNEL);
if (!devpath) {
error = -ENOMEM;
Expand Down

0 comments on commit 49e248c

Please sign in to comment.