]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Initialize err in probe_map_create
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 1 Aug 2022 02:51:09 +0000 (19:51 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 4 Aug 2022 21:40:00 +0000 (14:40 -0700)
commit955a77e13a2e4c49eec024c13d5eef91b29cc999
tree2f6152831fcdf9b66799cfa9b3312955e296219d
parent9ec2a055de08e1ad47c1ee753e20f05c2329eb33
libbpf: Initialize err in probe_map_create

GCC-11 warns about the possibly unitialized err variable in
probe_map_create:

libbpf_probes.c: In function 'probe_map_create':
libbpf_probes.c:361:38: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  361 |                 return fd < 0 && err == exp_err ? 1 : 0;
      |                                  ~~~~^~~~~~~~~~

Fixes: 890ae33d20d4 ("libbpf: Rework feature-probing APIs")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20220801025109.1206633-1-f.fainelli@gmail.com
tools/lib/bpf/libbpf_probes.c