Skip to content
Commit 69c35a48 authored by Lucas Stach's avatar Lucas Stach Committed by Richard Purdie
Browse files

perf: sort-pmuevents: really keep array terminators



Commit e1382583 ("perf: sort-pmuevents: don't drop elements") tried
to fix a case where the array terminator elements were dropped from the
sorted list breaking the build, but it only worked for the case where
the terminator is the only element of the array. When the array has other
elements the terminator will still be silently dropped, causing invalid
memory accesses at runtime when the perf utility iterates over the array.

Fix this by treating any unmatched entry as an array terminator and also
add a comment to make it a little more clear how things are ending up at
the right position in the sorted list.

Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
Signed-off-by: default avatarLuca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: default avatarRichard Purdie <richard.purdie@linuxfoundation.org>
parent e104c2b1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment