mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 17:22:07 +00:00
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20230605170553.7835-4-andriy.shevchenko@linux.intel.com
This commit is contained in:
parent
d01a77afd6
commit
b2f10148ec
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user