Commit 8e3c5ed9 authored by Ian Rogers's avatar Ian Rogers Committed by Luo Gengkun
Browse files

perf hist: Fix memory leak of a perf_hpp_fmt

mainline inclusion
from mainline-v5.16-rc2
commit 0ca1f534
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9S273
CVE: CVE-2021-47545

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0ca1f534a776cc7d42f2c33da4732b74ec2790cd



--------------------------------

perf_hpp__column_unregister() removes an entry from a list but doesn't
free the memory causing a memory leak spotted by leak sanitizer.

Add the free while at the same time reducing the scope of the function
to static.

Signed-off-by: default avatarIan Rogers <irogers@google.com>
Reviewed-by: default avatarKajol Jain <kjain@linux.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20211118071247.2140392-1-irogers@google.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarLuo Gengkun <luogengkun2@huawei.com>
parent aec28351
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment