提交 25fdeb3f 编写于 作者: I Ingo Oeser 提交者: Greg Kroah-Hartman

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: NIngo Oeser <ioe-lkml@rameria.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 6a55617e
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册