aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/syscall-counts.py
diff options
context:
space:
mode:
authorAmmar Faizi <ammarfaizi2@gnuweeb.org>2022-03-29 17:47:05 +0700
committerBorislav Petkov <bp@suse.de>2022-04-05 21:24:37 +0200
commite5f28623ceb103e13fc3d7bd45edf9818b227fd0 (patch)
tree9fd7e8fcb30f7f78c0480713ead8aa1af27f1280 /tools/perf/scripts/python/syscall-counts.py
parent9f1b19b977ee3cbd3fe9135ff63dbf221eac1d6a (diff)
downloadlinux-e5f28623ceb103e13fc3d7bd45edf9818b227fd0.tar.gz
linux-e5f28623ceb103e13fc3d7bd45edf9818b227fd0.tar.bz2
linux-e5f28623ceb103e13fc3d7bd45edf9818b227fd0.zip
x86/MCE/AMD: Fix memory leak when threshold_create_bank() fails
In mce_threshold_create_device(), if threshold_create_bank() fails, the previously allocated threshold banks array @bp will be leaked because the call to mce_threshold_remove_device() will not free it. This happens because mce_threshold_remove_device() fetches the pointer through the threshold_banks per-CPU variable but bp is written there only after the bank creation is successful, and not before, when threshold_create_bank() fails. Add a helper which unwinds all the bank creation work previously done and pass into it the previously allocated threshold banks array for freeing. [ bp: Massage. ] Fixes: 6458de97fc15 ("x86/mce/amd: Straighten CPU hotplug path") Co-developed-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org> Signed-off-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org> Co-developed-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20220329104705.65256-3-ammarfaizi2@gnuweeb.org
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
0 files changed, 0 insertions, 0 deletions