mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
perf tools: Use zfree() where applicable
In places where the equivalent was already being done, i.e.: free(a); a = NULL; And in placs where struct members are being freed so that if we have some erroneous reference to its struct, then accesses to freed members will result in segfaults, which we can detect faster than use after free to areas that may still have something seemingly valid. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-jatyoofo5boc1bsvoig6bb6i@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/bitmap.h>
|
||||
#include <linux/zalloc.h>
|
||||
#include "cpumap.h"
|
||||
#include "mem2node.h"
|
||||
#include "tests.h"
|
||||
@@ -67,7 +68,7 @@ int test__mem2node(struct test *t __maybe_unused, int subtest __maybe_unused)
|
||||
T("failed: mem2node__node", -1 == mem2node__node(&map, 0x1050));
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(nodes); i++)
|
||||
free(nodes[i].set);
|
||||
zfree(&nodes[i].set);
|
||||
|
||||
mem2node__exit(&map);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user