]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
perf map: Fix error return code in maps__clone()
authorZhen Lei <thunder.leizhen@huawei.com>
Thu, 15 Apr 2021 09:27:44 +0000 (17:27 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 7 May 2021 07:54:11 +0000 (09:54 +0200)
commit332937aa6aed5274892e9ff2eb758ef2334efb15
treec502716309ec9f15aae44e822a578e455a8b0663
parent6354a58c89c4328939c07a67c8bbd8872becc9f8
perf map: Fix error return code in maps__clone()

BugLink: https://bugs.launchpad.net/bugs/1927535
[ Upstream commit c6f87141254d16e281e4b4431af7316895207b8f ]

Although 'err' has been initialized to -ENOMEM, but it will be reassigned
by the "err = unwind__prepare_access(...)" statement in the for loop. So
that, the value of 'err' is unknown when map__clone() failed.

Fixes: 6c502584438bda63 ("perf unwind: Call unwind__prepare_access for forked thread")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.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: zhen lei <thunder.leizhen@huawei.com>
Link: http://lore.kernel.org/lkml/20210415092744.3793-1-thunder.leizhen@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
tools/perf/util/map.c