summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Tan <solomonbstoner@protonmail.ch>2019-04-03 11:17:49 +0800
committerSolomon Tan <solomonbstoner@protonmail.ch>2019-04-03 11:17:49 +0800
commitd203b175495462ee70a0c3327cf1e73c78169096 (patch)
tree4000df570d4e3e39d7b77216a48450b67054fd6a
parent38ec494285e019f9675ff5989e0025222a3b199c (diff)
downloadhonggfuzz-d203b175495462ee70a0c3327cf1e73c78169096.tar.gz
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 <solomonbstoner@protonmail.ch>
-rw-r--r--linux/perf.c1
1 files changed, 1 insertions, 0 deletions
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)");