perf stat: Fix error check return value of hashmap__new(), must use IS_ERR()
authorLv Ruyi <lv.ruyi@zte.com.cn>
Wed, 13 Apr 2022 09:33:02 +0000 (09:33 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 14 Apr 2022 01:20:15 +0000 (22:20 -0300)
commitd73f5d14e0cdd1f39764379250f26163913d7155
treedac1f3fb6bb6d660deb865678ac39643ca70f896
parentf034fc50d3c7d9385c20d505ab4cf56b8fd18ac7
perf stat: Fix error check return value of hashmap__new(), must use IS_ERR()

hashmap__new() returns ERR_PTR(-ENOMEM) when it fails, so we should use
IS_ERR() to check it in error handling path.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220413093302.2538128-1-lv.ruyi@zte.com.cn
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/stat.c