mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02: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:
committed by
Kees Cook
parent
d01a77afd6
commit
b2f10148ec
@@ -281,8 +281,7 @@ int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
|
|||||||
kfree_const(s);
|
kfree_const(s);
|
||||||
if (!t)
|
if (!t)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
strreplace(t, '/', '!');
|
s = strreplace(t, '/', '!');
|
||||||
s = t;
|
|
||||||
}
|
}
|
||||||
kfree_const(kobj->name);
|
kfree_const(kobj->name);
|
||||||
kobj->name = s;
|
kobj->name = s;
|
||||||
|
Reference in New Issue
Block a user