From: Souptick Joarder (HPE) Date: Sat, 19 Feb 2022 16:39:15 +0000 (+0530) Subject: bpf: Initialize ret to 0 inside btf_populate_kfunc_set() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d0b3822902b6af45f2c75706d7eb2a35aacab223;p=linux.git bpf: Initialize ret to 0 inside btf_populate_kfunc_set() Kernel test robot reported below error -> kernel/bpf/btf.c:6718 btf_populate_kfunc_set() error: uninitialized symbol 'ret'. Initialize ret to 0. Fixes: dee872e124e8 ("bpf: Populate kfunc BTF ID sets in struct btf") Reported-by: kernel test robot Signed-off-by: Souptick Joarder (HPE) Signed-off-by: Alexei Starovoitov Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/bpf/20220219163915.125770-1-jrdr.linux@gmail.com --- diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 02d7014417a0a..2c4c5dbe2abe8 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -6706,7 +6706,7 @@ static int btf_populate_kfunc_set(struct btf *btf, enum btf_kfunc_hook hook, const struct btf_kfunc_id_set *kset) { bool vmlinux_set = !btf_is_module(btf); - int type, ret; + int type, ret = 0; for (type = 0; type < ARRAY_SIZE(kset->sets); type++) { if (!kset->sets[type])