Re: [PATCH 1/1] perf map: Fix error return code in maps__clone()

2021-04-15 Thread Leizhen (ThunderTown)
On 2021/4/15 20:42, Arnaldo Carvalho de Melo wrote: > Em Thu, Apr 15, 2021 at 05:27:44PM +0800, Zhen Lei escreveu: >> 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'

Re: [PATCH 1/1] perf map: Fix error return code in maps__clone()

2021-04-15 Thread Arnaldo Carvalho de Melo
Em Thu, Apr 15, 2021 at 05:27:44PM +0800, Zhen Lei escreveu: > 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. You forgot to research

Re: [PATCH 1/1] perf map: Fix error return code in maps__clone()

2021-04-15 Thread Jiri Olsa
On Thu, Apr 15, 2021 at 05:27:44PM +0800, Zhen Lei wrote: > 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. > > Reported-by: Hulk Rob

[PATCH 1/1] perf map: Fix error return code in maps__clone()

2021-04-15 Thread Zhen Lei
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. Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- tools/perf/util/map.c | 7 +--