[PATCH 5.2 123/215] perf trace: Fix potential NULL pointer dereference found by the smatch tool