diff options
author | Ian Rogers <[email protected]> | 2023-10-09 11:39:06 -0700 |
---|---|---|
committer | Namhyung Kim <[email protected]> | 2023-10-12 10:01:55 -0700 |
commit | da0c884b0756fc97a1c15f4cdb81e0a8490a6d7e (patch) | |
tree | abea99d02dc1db1279da8bfce1a011bebee8df84 | |
parent | b24520ffa9695c7249bdd181cf10bc0a3e365019 (diff) |
perf bench uprobe: Fix potential use of memory after free
Found by clang-tidy:
```
bench/uprobe.c:98:3: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
bench_uprobe_bpf__destroy(skel);
```
Signed-off-by: Ian Rogers <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Ravi Bangoria <[email protected]>
Cc: Nick Desaulniers <[email protected]>
Cc: Yang Jihong <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: [email protected]
Cc: Ming Wang <[email protected]>
Cc: Tom Rix <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected]>
-rw-r--r-- | tools/perf/bench/uprobe.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/bench/uprobe.c b/tools/perf/bench/uprobe.c index 914c0817fe8a..5c71fdc419dd 100644 --- a/tools/perf/bench/uprobe.c +++ b/tools/perf/bench/uprobe.c @@ -89,6 +89,7 @@ static int bench_uprobe__setup_bpf_skel(enum bench_uprobe bench) return err; cleanup: bench_uprobe_bpf__destroy(skel); + skel = NULL; return err; } |