aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/switch-tracking.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/switch-tracking.c')
-rw-r--r--tools/perf/tests/switch-tracking.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index 9b5be51e5e7b..6cdab5f4812a 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -4,6 +4,7 @@
#include <errno.h>
#include <time.h>
#include <stdlib.h>
+#include <linux/zalloc.h>
#include "parse-events.h"
#include "evlist.h"
@@ -237,7 +238,7 @@ static void free_event_nodes(struct list_head *events)
while (!list_empty(events)) {
node = list_entry(events->next, struct event_node, list);
- list_del(&node->list);
+ list_del_init(&node->list);
free(node);
}
}