Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143738
b: refs/heads/master
c: 8a577ff
h: refs/heads/master
v: v3
  • Loading branch information
Kay Sievers authored and Linus Torvalds committed Apr 20, 2009
1 parent 6988d80 commit 6323c4d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d91dfbb41bb2e9bdbfbd2cc7078ed7436eab027a
refs/heads/master: 8a577ffc75d9194fe8cdb7479236f2081c26ca1f
3 changes: 2 additions & 1 deletion trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,8 @@ int device_add(struct device *dev)
set_dev_node(dev, dev_to_node(parent));

/* first, register with generic layer. */
error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev_name(dev));
/* we require the name to be set before, and pass NULL */
error = kobject_add(&dev->kobj, dev->kobj.parent, NULL);
if (error)
goto Error;

Expand Down
3 changes: 3 additions & 0 deletions trunk/lib/kobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
const char *old_name = kobj->name;
char *s;

if (kobj->name && !fmt)
return 0;

kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs);
if (!kobj->name)
return -ENOMEM;
Expand Down

0 comments on commit 6323c4d

Please sign in to comment.