Skip to content

Commit b2f1014

Browse files
andy-shevkees
authored andcommitted
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 <[email protected]> Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d01a77a commit b2f1014

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/kobject.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,7 @@ int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
281281
kfree_const(s);
282282
if (!t)
283283
return -ENOMEM;
284-
strreplace(t, '/', '!');
285-
s = t;
284+
s = strreplace(t, '/', '!');
286285
}
287286
kfree_const(kobj->name);
288287
kobj->name = s;

0 commit comments

Comments
 (0)