Re: [PATCH] perf util: Fix wrong processing when closing evsel fd

From: Jiri Olsa
Date: Wed Oct 18 2017 - 04:13:29 EST


On Wed, Oct 18, 2017 at 11:11:18PM +0800, Jin Yao wrote:

SNIP

> This change is introduced by "475fb533fb7d"
> ("perf evsel: Fix buffer overflow while freeing events")
>
> This fix is to let xyarray__max_x() return max_x (ncpus) and
> let xyarry__max_y() return max_y (nthreads)
>
> Signed-off-by: Jin Yao <yao.jin@xxxxxxxxxxxxxxx>
> ---
> tools/perf/util/xyarray.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/xyarray.h b/tools/perf/util/xyarray.h
> index 4ba726c..54af6046 100644
> --- a/tools/perf/util/xyarray.h
> +++ b/tools/perf/util/xyarray.h
> @@ -23,12 +23,12 @@ static inline void *xyarray__entry(struct xyarray *xy, int x, int y)
>
> static inline int xyarray__max_y(struct xyarray *xy)
> {
> - return xy->max_x;
> + return xy->max_y;
> }
>
> static inline int xyarray__max_x(struct xyarray *xy)
> {
> - return xy->max_y;
> + return xy->max_x;
> }

oops, thanks!

Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx>

jirka