[PATCH 5.4 29/74] perf/core: Fix potential NULL deref