]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Initialise retval in bpf_prog_test_run_xdp()
authorToke Høiland-Jørgensen <toke@redhat.com>
Thu, 10 Mar 2022 11:02:28 +0000 (12:02 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 10 Mar 2022 15:12:10 +0000 (16:12 +0100)
commit87c42b1f01c6144073292d308cd8b424870487f3
treeaf9c0519461270ad0c8134e37c5c6831e7d8fb31
parentbba8c38d1fb360cb94b2ad0f57a26f8fe956b959
bpf: Initialise retval in bpf_prog_test_run_xdp()

The kernel test robot pointed out that the newly added
bpf_test_run_xdp_live() runner doesn't set the retval in the caller (by
design), which means that the variable can be passed unitialised to
bpf_test_finish(). Fix this by initialising the variable properly.

Fixes: 2fd77f465c66 ("bpf: Add "live packet" mode for XDP in BPF_PROG_RUN")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220310110228.161869-1-toke@redhat.com
net/bpf/test_run.c