linux/tools
Daniel T. Lee 932ac54a3e libbf: Fix uninitialized pointer at btf__parse_raw()
Recently, from commit 94a1fedd63 ("libbpf: Add btf__parse_raw() and
generic btf__parse() APIs"), new API has been added to libbpf that
allows to parse BTF from raw data file (btf__parse_raw()).

The commit derives build failure of samples/bpf due to improper access
of uninitialized pointer at btf_parse_raw().

    btf.c: In function btf__parse_raw:
    btf.c:625:28: error: btf may be used uninitialized in this function
      625 |  return err ? ERR_PTR(err) : btf;
          |         ~~~~~~~~~~~~~~~~~~~^~~~~

This commit fixes the build failure of samples/bpf by adding code of
initializing btf pointer as NULL.

Fixes: 94a1fedd63 ("libbpf: Add btf__parse_raw() and generic btf__parse() APIs")
Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200805223359.32109-1-danieltimlee@gmail.com
2020-08-06 16:47:00 -07:00
..
accounting
arch tools arch kvm: Sync kvm headers with the kernel sources 2020-07-17 09:39:16 -03:00
bootconfig tools/bootconfig: Add testcase for show-command and quotes test 2020-06-16 21:21:03 -04:00
bpf tools/bpf: Support new uapi for map element bpf iterator 2020-08-06 16:39:14 -07:00
build tools, build: Propagate build failures from tools/build/Makefile.build 2020-08-03 16:15:40 +02:00
cgroup iocost_monitor: start from the oldest usage index 2020-07-30 11:45:29 -06:00
debugging
edid
firewire
firmware
gpio tools: gpio: fix spurious close warning in gpio-event-mon 2020-07-12 10:22:01 +02:00
hv tools: hv: change http to https in hv_kvp_daemon.c 2020-07-06 10:46:23 +00:00
iio
include tools/bpf: Support new uapi for map element bpf iterator 2020-08-06 16:39:14 -07:00
io_uring io_uring: change the poll type to be 32-bits 2020-06-21 20:44:00 -06:00
kvm/kvm_stat
laptop
leds
lib libbf: Fix uninitialized pointer at btf__parse_raw() 2020-08-06 16:47:00 -07:00
memory-model These were the main changes in this cycle: 2020-08-03 14:39:35 -07:00
nfsd
objtool Misc updates: 2020-08-03 14:45:33 -07:00
pci
pcmcia
perf Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-08-02 01:02:12 -07:00
power ACPI updates for 5.9-rc1 2020-08-03 20:37:22 -07:00
scripts
spi spi: tools: Make default_tx/rx and input_tx static 2020-06-11 16:27:24 +01:00
testing tools/bpf: Support new uapi for map element bpf iterator 2020-08-06 16:39:14 -07:00
thermal/tmon
time
usb tools: usb: usbip: Replace HTTP links with HTTPS ones 2020-07-15 16:33:51 +02:00
virtio compiler: Remove uninitialized_var() macro 2020-07-16 12:35:31 -07:00
vm
wmi
Makefile bpf: Compile resolve_btfids tool at kernel compilation start 2020-07-13 10:42:02 -07:00