Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104713
b: refs/heads/master
c: 9f25565
h: refs/heads/master
i:
  104711: e5c9efa
v: v3
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Jul 22, 2008
1 parent efe3812 commit 665280e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 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: e105b8bfc769b0545b6f0f395179d1e43cbee822
refs/heads/master: 9f255651fb41c111ee35a2ae632df8ce9bd61def
10 changes: 8 additions & 2 deletions trunk/lib/kobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,19 @@ static int kobject_add_internal(struct kobject *kobj)
static int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
va_list vargs)
{
/* Free the old name, if necessary. */
kfree(kobj->name);
const char *old_name = kobj->name;
char *s;

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

/* ewww... some of these buggers have '/' in the name ... */
s = strchr(kobj->name, '/');
if (s)
s[0] = '!';

kfree(old_name);
return 0;
}

Expand Down

0 comments on commit 665280e

Please sign in to comment.