No description
Find a file
Leo Yan 19cf571c64 perf top: Fix potential NULL pointer dereference detected by the smatch tool
[ Upstream commit 111442cfc8 ]

Based on the following report from Smatch, fix the potential NULL
pointer dereference check.

  tools/perf/builtin-top.c:109
  perf_top__parse_source() warn: variable dereferenced before check 'he'
  (see line 103)

  tools/perf/builtin-top.c:233
  perf_top__show_details() warn: variable dereferenced before check 'he'
  (see line 228)

  tools/perf/builtin-top.c
  101 static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
  102 {
  103         struct perf_evsel *evsel = hists_to_evsel(he->hists);
                                                        ^^^^
  104         struct symbol *sym;
  105         struct annotation *notes;
  106         struct map *map;
  107         int err = -1;
  108
  109         if (!he || !he->ms.sym)
  110                 return -1;

This patch moves the values assignment after validating pointer 'he'.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Alexios Zavras <alexios.zavras@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Changbin Du <changbin.du@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Eric Saint-Etienne <eric.saint.etienne@oracle.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Song Liu <songliubraving@fb.com>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/20190702103420.27540-4-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-07-31 07:27:06 +02:00
arch arm64: assembler: Switch ESB-instruction with a vanilla nop if !ARM64_HAS_RAS 2019-07-31 07:27:05 +02:00
block blkcg: update blkcg_print_stat() to handle larger outputs 2019-07-26 09:14:30 +02:00
certs
crypto crypto: chacha20poly1305 - fix atomic sleep when using async algorithm 2019-07-26 09:14:19 +02:00
Documentation dt-bindings: allow up to four clocks for orion-mdio 2019-07-26 09:14:30 +02:00
drivers PCI: mobiveil: Use the 1st inbound window for MEM inbound transactions 2019-07-31 07:27:06 +02:00
firmware
fs ext4: allow directory holes 2019-07-28 08:29:30 +02:00
include gpu: host1x: Increase maximum DMA segment size 2019-07-31 07:26:59 +02:00
init initramfs: free initrd memory if opening /initrd.image fails 2019-06-15 11:54:01 +02:00
ipc ipc: prevent lockup on alloc_msg and free_msg 2019-06-15 11:54:00 +02:00
kernel perf/core: Fix race between close() and fork() 2019-07-28 08:29:28 +02:00
lib lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE 2019-07-26 09:14:23 +02:00
LICENSES
mm mm/swap: fix release_pages() when releasing devmap pages 2019-07-31 07:27:03 +02:00
net hvsock: fix epollout hang from race condition 2019-07-31 07:26:56 +02:00
samples samples, bpf: suppress compiler warning 2019-07-14 08:11:04 +02:00
scripts kallsyms: exclude kasan local symbols on s390 2019-07-31 07:27:05 +02:00
security selinux: fix empty write to keycreate file 2019-07-26 09:14:07 +02:00
sound ALSA: hda/realtek: apply ALC891 headset fixup to one Dell machine 2019-07-26 09:14:23 +02:00
tools perf top: Fix potential NULL pointer dereference detected by the smatch tool 2019-07-31 07:27:06 +02:00
usr
virt KVM: arm/arm64: vgic: Fix kvm_device leak in vgic_its_destroy 2019-07-14 08:11:10 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS platform/x86: Add Intel AtomISP2 dummy / power-management driver 2019-04-20 09:16:02 +02:00
Makefile kbuild: Add -Werror=unknown-warning-option to CLANG_FLAGS 2019-07-31 07:27:02 +02:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.