Commit b2f10148 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Kees Cook

kobject: Use return value of strreplace()

Since strreplace() returns the pointer to the string itself,
we may use it directly in the code.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230605170553.7835-4-andriy.shevchenko@linux.intel.com
parent d01a77af
......@@ -281,8 +281,7 @@ int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
kfree_const(s);
if (!t)
return -ENOMEM;
strreplace(t, '/', '!');
s = t;
s = strreplace(t, '/', '!');
}
kfree_const(kobj->name);
kobj->name = s;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment