diff options
author | Ingo Oeser <ioe-lkml@rameria.de> | 2008-07-22 19:25:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-08-21 13:15:34 -0400 |
commit | 25fdeb3f4468595ab2885687b13515fa848731c2 (patch) | |
tree | 841454db8ff56dfa260cc0a277023815909dbc7a /lib/kobject.c | |
parent | 6a55617ed5d1aa62b850de2cf66f5ede2eef4825 (diff) |
kobject: Replace ALL occurrences of '/' with '!' instead of only the first one.
A recent patch from Kay Sievers <kay.sievers@vrfy.org>
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 <ioe-lkml@rameria.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib/kobject.c')
-rw-r--r-- | lib/kobject.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index bd732ffebc85..fbf0ae282376 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -223,8 +223,7 @@ static int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, | |||
223 | return -ENOMEM; | 223 | return -ENOMEM; |
224 | 224 | ||
225 | /* ewww... some of these buggers have '/' in the name ... */ | 225 | /* ewww... some of these buggers have '/' in the name ... */ |
226 | s = strchr(kobj->name, '/'); | 226 | while ((s = strchr(kobj->name, '/'))) |
227 | if (s) | ||
228 | s[0] = '!'; | 227 | s[0] = '!'; |
229 | 228 | ||
230 | kfree(old_name); | 229 | kfree(old_name); |