linux/arch/riscv/net
Chenghao Duan e628b0524b riscv: bpf: Fix uninitialized symbol 'retval_off'
[ Upstream commit d0bf7cd5df ]

In the __arch_prepare_bpf_trampoline() function, retval_off is only
meaningful when save_ret is true, so the current logic is correct.
However, in the original logic, retval_off is only initialized under
certain conditions; for example, in the fmod_ret logic, the compiler is
not aware that the flags of the fmod_ret program (prog) have set
BPF_TRAMP_F_CALL_ORIG, which results in an uninitialized symbol
compilation warning.

So initialize retval_off unconditionally to fix it.

Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
Reviewed-by: Pu Lehui <pulehui@huawei.com>
Link: https://lore.kernel.org/r/20250922062244.822937-2-duanchenghao@kylinos.cn
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-11-13 15:34:07 -05:00
..
bpf_jit.h riscv, bpf: Introduce shift add helper with Zba optimization 2024-06-03 16:45:23 +02:00
bpf_jit_comp32.c riscv, bpf: Introduce shift add helper with Zba optimization 2024-06-03 16:45:23 +02:00
bpf_jit_comp64.c riscv: bpf: Fix uninitialized symbol 'retval_off' 2025-11-13 15:34:07 -05:00
bpf_jit_core.c bpf: remove unused parameter in bpf_jit_binary_pack_finalize 2024-06-20 19:50:26 -07:00
Makefile riscv, bpf: Add RV32G eBPF JIT 2020-03-05 16:13:47 +01:00