From d203b175495462ee70a0c3327cf1e73c78169096 Mon Sep 17 00:00:00 2001 From: Solomon Tan Date: Wed, 3 Apr 2019 11:17:49 +0800 Subject: linux/perf.c: Assign perfMmapAux pointer to NULL upon failed mmap When mmap fails to map memory for `run->linux.perfMmapAux`, the pointer should be set to NULL. This is also done for `run->linux.perfMmapBuf`. Signed-off-by: Solomon Tan --- linux/perf.c | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/perf.c') diff --git a/linux/perf.c b/linux/perf.c index b7355e04..f3b805d7 100644 --- a/linux/perf.c +++ b/linux/perf.c @@ -199,6 +199,7 @@ static bool arch_perfCreate(run_t* run, pid_t pid, dynFileMethod_t method, int* NULL, pem->aux_size, PROT_READ, MAP_SHARED, *perfFd, pem->aux_offset)) == MAP_FAILED) { munmap(run->linux.perfMmapBuf, _HF_PERF_MAP_SZ + getpagesize()); run->linux.perfMmapBuf = NULL; + run->linux.perfMmapAux = NULL; PLOG_W( "mmap(mmapAuxBuf) failed, try increasing the kernel.perf_event_mlock_kb sysctl (up to " "even 300000000)"); -- cgit v1.2.3