mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
kobject: Replace ALL occurrences of '/' with '!' instead of only the 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]>
This commit is contained in:
1 parent
6a55617ed5
commit
25fdeb3f44
1 file changed
+1
-2
+1
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user