]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, sysctl: Let bpf_stats_handler take a kernel pointer buffer
authorTobias Klauser <tklauser@distanz.ch>
Mon, 24 Aug 2020 14:20:47 +0000 (16:20 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 25 Aug 2020 04:11:40 +0000 (21:11 -0700)
commitc863875ed2677c393318d01fef3e4c90dfa126ba
treed4c939ae5c785993e24366a29adb3b5b5b4ad90e
parent5c641f361bd363f37b82025f060c79602f1a5bc6
bpf, sysctl: Let bpf_stats_handler take a kernel pointer buffer

Commit 601626d6a421 ("sysctl: pass kernel pointers to ->proc_handler")
changed ctl_table.proc_handler to take a kernel pointer. Adjust the
signature of bpf_stats_handler to match ctl_table.proc_handler which
fixes the following sparse warning:

kernel/sysctl.c:226:49: warning: incorrect type in argument 3 (different address spaces)
kernel/sysctl.c:226:49:    expected void *
kernel/sysctl.c:226:49:    got void [noderef] __user *buffer
kernel/sysctl.c:2640:35: warning: incorrect type in initializer (incompatible argument 3 (different address spaces))
kernel/sysctl.c:2640:35:    expected int ( [usertype] *proc_handler )( ... )
kernel/sysctl.c:2640:35:    got int ( * )( ... )

Fixes: 601626d6a421 ("sysctl: pass kernel pointers to ->proc_handler")
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/bpf/20200824142047.22043-1-tklauser@distanz.ch
kernel/sysctl.c