]> git.baikalelectronics.ru Git - 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)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 23 Apr 2021 19:03:09 +0000 (16:03 -0300)
commitb62dca5a0726906885034e1f7f10f356a8584199
tree97d1fc800d5a8c67f1ead9efbae36804d62629b2
parentf74320eab163243fcf18bb79b2a5bd9776e08388
perf map: Fix error return code in maps__clone()

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: e70e821fcb160e0e ("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>
tools/perf/util/map.c