Message ID | 20220314130201.6356821a@gandalf.local.home (mailing list archive) |
---|---|
State | Accepted |
Commit | 99660051e2b55be77dd638e0cce31ce6879cace5 |
Headers | show |
Series | trace-cmd library: Fix off by one in tracecmd_read_cpu_first() | expand |
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c index 313534d09e86..643dd807c575 100644 --- a/lib/trace-cmd/trace-input.c +++ b/lib/trace-cmd/trace-input.c @@ -2028,7 +2028,7 @@ tracecmd_read_cpu_first(struct tracecmd_input *handle, int cpu) unsigned long long page_offset; int ret; - if (cpu > handle->cpus) + if (cpu >= handle->cpus) return NULL; page_offset = calc_page_offset(handle, handle->cpu_data[cpu].file_offset);