]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
perf data: Fix error return code in perf_data__create_dir()
authorZhen Lei <thunder.leizhen@huawei.com>
Thu, 15 Apr 2021 08:34:16 +0000 (16:34 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 19 May 2021 08:03:33 +0000 (10:03 +0200)
commit5dc897c025ca8fad807f452a72a2ae5f81cdb92a
tree61a6cbcebd7bb5d75b15aeefdddd59f27f767809
parent29668be20eb1fb5d03c6ede469664abf1661777b
perf data: Fix error return code in perf_data__create_dir()

BugLink: https://bugs.launchpad.net/bugs/1928850
[ Upstream commit f2211881e737cade55e0ee07cf6a26d91a35a6fe ]

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

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>
Link: http://lore.kernel.org/lkml/20210415083417.3740-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: Stefan Bader <stefan.bader@canonical.com>
tools/perf/util/data.c