Skip to content
Commit 4829c791 authored by Dennis Zhou's avatar Dennis Zhou
Browse files

percpu: initialize best_upa variable

Tom reported this finding from clang 10's static analysis [1].

Due to the way the code is written, it will always see a successful loop
iteration. Instead of setting an initial value, check that it was set
instead with BUG_ON() because 0 units per allocation is bogus.

[1] https://lore.kernel.org/lkml/20210515180817.1751084-1-trix@redhat.com/



Reported-by: default avatarTom Rix <trix@redhat.com>
Signed-off-by: default avatarDennis Zhou <dennis@kernel.org>
parent faf65dde
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