Skip to content

Commit 67352ed

Browse files
Chenghao DuanKernel Patches Daemon
authored andcommitted
riscv: bpf: Fix uninitialized symbol 'retval_off'
In __arch_prepare_bpf_trampoline(), 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, which may cause a build warning. So initialize retval_off unconditionally to fix it. Signed-off-by: Chenghao Duan <[email protected]>
1 parent 28cde7b commit 67352ed

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/riscv/net/bpf_jit_comp64.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,10 +1028,9 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im,
10281028
stack_size += 16;
10291029

10301030
save_ret = flags & (BPF_TRAMP_F_CALL_ORIG | BPF_TRAMP_F_RET_FENTRY_RET);
1031-
if (save_ret) {
1031+
if (save_ret)
10321032
stack_size += 16; /* Save both A5 (BPF R0) and A0 */
1033-
retval_off = stack_size;
1034-
}
1033+
retval_off = stack_size;
10351034

10361035
stack_size += nr_arg_slots * 8;
10371036
args_off = stack_size;

0 commit comments

Comments
 (0)