]> git.baikalelectronics.ru Git - kernel.git/commit
percpu: initialize best_upa variable
authorDennis Zhou <dennis@kernel.org>
Mon, 14 Jun 2021 14:42:05 +0000 (14:42 +0000)
committerDennis Zhou <dennis@kernel.org>
Mon, 14 Jun 2021 14:42:05 +0000 (14:42 +0000)
commitbcf4ce6995d7d65bbb77d899016839fe6845b741
treeccd014d07bde7da164bf24375d263f1952c6eb49
parent1d351ae45a86c426f1cfc1bc68a9c2f70ad80757
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: Tom Rix <trix@redhat.com>
Signed-off-by: Dennis Zhou <dennis@kernel.org>
mm/percpu.c