Skip to content
Snippets Groups Projects
Commit 01bb11ad authored by Yury Norov's avatar Yury Norov Committed by Jakub Kicinski
Browse files

sched/topology: fix KASAN warning in hop_cmp()


Despite that prev_hop is used conditionally on cur_hop
is not the first hop, it's initialized unconditionally.

Because initialization implies dereferencing, it might happen
that the code dereferences uninitialized memory, which has been
spotted by KASAN. Fix it by reorganizing hop_cmp() logic.

Reported-by: default avatarBruno Goncalves <bgoncalv@redhat.com>
Fixes: cd7f5535 ("sched: add sched_numa_find_nth_cpu()")
Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
Link: https://lore.kernel.org/r/Y+7avK6V9SyAWsXi@yury-laptop/


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3fcdf2df
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment