summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/resctrl/fill_buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/resctrl/fill_buf.c')
-rw-r--r--tools/testing/selftests/resctrl/fill_buf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c
index c20d0a7ecbe6..ab1d91328d67 100644
--- a/tools/testing/selftests/resctrl/fill_buf.c
+++ b/tools/testing/selftests/resctrl/fill_buf.c
@@ -184,12 +184,13 @@ fill_cache(unsigned long long buf_size, int malloc_and_init, int memflush,
else
ret = fill_cache_write(start_ptr, end_ptr, resctrl_val);
+ free(startptr);
+
if (ret) {
printf("\n Error in fill cache read/write...\n");
return -1;
}
- free(startptr);
return 0;
}