]> git.baikalelectronics.ru Git - kernel.git/commit
perf evsel: Fix potential null pointer dereference in perf_evsel__new_idx()
authorHisao Tanabe <xtanabe@gmail.com>
Fri, 24 Aug 2018 15:45:56 +0000 (00:45 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 30 Aug 2018 17:49:25 +0000 (14:49 -0300)
commit3bf2ebf9c005485e7c73dfaf1ff71eac86cf7b73
tree2f0b990e3a6909a7185ae5d80274af542409d642
parent7e8ec76ef2cb43d27339a2b48c7c9e614641ebe5
perf evsel: Fix potential null pointer dereference in perf_evsel__new_idx()

If evsel is NULL, we should return NULL to avoid a NULL pointer
dereference a bit later in the code.

Signed-off-by: Hisao Tanabe <xtanabe@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 7dee44329d75 ("perf tools: Introduce bpf-output event")
LPU-Reference: 20180824154556.23428-1-xtanabe@gmail.com
Link: https://lkml.kernel.org/n/tip-e5plzjhx6595a5yjaf22jss3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evsel.c