linux56/57-tkg: Workaround a warning (treated as error with default config) on GCC10 by initializing nr_pages_avail in virt/kvm/kvm_main.c

This commit is contained in:
Tk-Glitch
2020-05-10 19:19:07 +02:00
parent 064d5a39df
commit 13baf8c326
4 changed files with 26 additions and 2 deletions

View File

@@ -1445,3 +1445,15 @@ index d2fa3e9ccd97c..bd10cb02fc0ff 100644
force_load = 1;
if (!strcmp(str, "hwp_only"))
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2214,7 +2214,7 @@ static int __kvm_gfn_to_hva_cache_init(struct kvm_memslots *slots,
gfn_t start_gfn = gpa >> PAGE_SHIFT;
gfn_t end_gfn = (gpa + len - 1) >> PAGE_SHIFT;
gfn_t nr_pages_needed = end_gfn - start_gfn + 1;
- gfn_t nr_pages_avail;
+ gfn_t nr_pages_avail = 0;
/* Update ghc->generation before performing any error checks. */
ghc->generation = slots->generation;