summaryrefslogtreecommitdiff
path: root/tools/perf/util/bpf_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/bpf_map.c')
-rw-r--r--tools/perf/util/bpf_map.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/perf/util/bpf_map.c b/tools/perf/util/bpf_map.c
index c863ae0c5cb5..442f91b4e8e1 100644
--- a/tools/perf/util/bpf_map.c
+++ b/tools/perf/util/bpf_map.c
@@ -5,6 +5,7 @@
#include <bpf/libbpf.h>
#include <linux/err.h>
#include <linux/kernel.h>
+#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
@@ -35,9 +36,6 @@ int bpf_map__fprintf(struct bpf_map *map, FILE *fp)
if (fd < 0)
return fd;
- if (!map)
- return PTR_ERR(map);
-
err = -ENOMEM;
key = malloc(bpf_map__key_size(map));
if (key == NULL)