]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
perf lock: Fix option value type in parse_max_stack
authorIan Rogers <irogers@google.com>
Thu, 19 Mar 2026 23:33:48 +0000 (16:33 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 26 Mar 2026 22:02:42 +0000 (15:02 -0700)
The value is a void* and the address of an int, max_stack_depth, is
set up in the perf lock options. The parse_max_stack function treats
the int* as a long*, make this more correct by declaring the value to
be an int*.

Fixes: 0a277b622670 ("perf lock contention: Check --max-stack option")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-lock.c

index e8962c985d34a179060955b5d3fbe2670eb94732..5585aeb97684dd36178405c74fe92c4f592b6446 100644 (file)
@@ -2250,7 +2250,7 @@ static int parse_map_entry(const struct option *opt, const char *str,
 static int parse_max_stack(const struct option *opt, const char *str,
                           int unset __maybe_unused)
 {
-       unsigned long *len = (unsigned long *)opt->value;
+       int *len = opt->value;
        long val;
        char *endptr;