diff options
author | Dennis Zhou <dennis@kernel.org> | 2021-06-14 14:42:05 +0000 |
---|---|---|
committer | Dennis Zhou <dennis@kernel.org> | 2021-06-14 14:42:05 +0000 |
commit | 4829c791b22f98f95339248a428caf08b5f1e3e5 (patch) | |
tree | ccd014d07bde7da164bf24375d263f1952c6eb49 /mm/percpu-vm.c | |
parent | faf65dde844affa9e360ccaa4bd231c2a04b87ea (diff) | |
download | linux-4829c791b22f98f95339248a428caf08b5f1e3e5.tar.gz linux-4829c791b22f98f95339248a428caf08b5f1e3e5.tar.bz2 linux-4829c791b22f98f95339248a428caf08b5f1e3e5.zip |
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>
Diffstat (limited to 'mm/percpu-vm.c')
0 files changed, 0 insertions, 0 deletions