linux/tools
Arnaldo Carvalho de Melo 8a2efd6dd5 perf probe: Avoid accessing uninitialized 'map' variable
Genuine problem detected with clang, the warnings are spot on:

  util/probe-event.c:2079:7: error: variable 'map' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
                  if (addr) {
                      ^~~~
  util/probe-event.c:2094:6: note: uninitialized use occurs here
          if (map && !is_kprobe) {
              ^~~
  util/probe-event.c:2079:3: note: remove the 'if' if its condition is always true
                  if (addr) {
                  ^~~~~~~~~~
  util/probe-event.c:2075:8: error: variable 'map' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
                          if (kernel_get_symbol_address_by_name(tp->symbol,
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  util/probe-event.c:2094:6: note: uninitialized use occurs here
          if (map && !is_kprobe) {
              ^~~
  util/probe-event.c:2075:4: note: remove the 'if' if its condition is always false
                          if (kernel_get_symbol_address_by_name(tp->symbol,
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  util/probe-event.c:2064:17: note: initialize the variable 'map' to silence this warning
          struct map *map;
                         ^
                          = NULL

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-m3501el55i10hctfbmi2qxzr@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-02-14 15:28:41 -03:00
..
accounting
arch
build
cgroup
firewire
gpio
hv
iio
include tools include: Introduce linux/compiler-gcc.h 2017-02-13 14:29:29 -03:00
kvm/kvm_stat
laptop
leds
lguest
lib tools lib subcmd: Make it an error to pass a signed value to OPTION_UINTEGER 2017-02-14 15:19:17 -03:00
net
nfsd
objtool
pcmcia
perf perf probe: Avoid accessing uninitialized 'map' variable 2017-02-14 15:28:41 -03:00
power
scripts tools: Suppress request for warning options not existent in clang 2017-02-14 10:34:35 -03:00
spi
testing
thermal/tmon
time
usb
virtio
vm
Makefile