bpf: Initialize ret to 0 inside btf_populate_kfunc_set()
authorSouptick Joarder (HPE) <jrdr.linux@gmail.com>
Sat, 19 Feb 2022 16:39:15 +0000 (22:09 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 20 Feb 2022 01:26:52 +0000 (17:26 -0800)
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 <lkp@intel.com>
Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/bpf/20220219163915.125770-1-jrdr.linux@gmail.com
kernel/bpf/btf.c

index 02d7014417a0acdcda2427b3ac806978a0e76205..2c4c5dbe2abe87259dbbfe32b7660b2ef0aa1275 100644 (file)
@@ -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])