]> git.baikalelectronics.ru Git - kernel.git/commit
proc: proc_skip_spaces() shouldn't think it is working on C strings
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 5 Dec 2022 20:09:06 +0000 (12:09 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:23:06 +0000 (11:23 +0100)
commit2a1c9a22bfd8e49b3273e4dfecb60eec4ec578ef
treeaf458910ef8b3a1ab4e8cb3253049436b49913f9
parentbb567e32b35bc59e58de0029ff3d596d5a9822e4
proc: proc_skip_spaces() shouldn't think it is working on C strings

commit 6fd19aeae54edc70845130eebdd738f8ec2813b7 upstream.

proc_skip_spaces() seems to think it is working on C strings, and ends
up being just a wrapper around skip_spaces() with a really odd calling
convention.

Instead of basing it on skip_spaces(), it should have looked more like
proc_skip_char(), which really is the exact same function (except it
skips a particular character, rather than whitespace).  So use that as
inspiration, odd coding and all.

Now the calling convention actually makes sense and works for the
intended purpose.

Reported-and-tested-by: Kyle Zeng <zengyhkyle@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/sysctl.c