Skip to content

Commit

Permalink
kobject: Replace ALL occurrences of '/' with '!' instead of only the …
Browse files Browse the repository at this point in the history
…first one.

A recent patch from Kay Sievers <[email protected]>
replaced the first occurrence of '/' with '!' as needed for block devices.

Now do some cheap defensive coding and replace all of them to avoid future
issues in this area.

Signed-off-by: Ingo Oeser <[email protected]>
Cc: Kay Sievers <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Ingo Oeser authored and gregkh committed Aug 21, 2008
1 parent 6a55617 commit 25fdeb3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/kobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,7 @@ static int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
return -ENOMEM;

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

kfree(old_name);
Expand Down

0 comments on commit 25fdeb3

Please sign in to comment.