Skip to content

Commit 92b6c2f

Browse files
Dan Carpenterbonzini
authored andcommitted
KVM: SVM: Fix uninitialized variable bug
If snp_lookup_rmpentry() fails then "assigned" is printed in the error message but it was never initialized. Initialize it to false. Fixes: dee5a47 ("KVM: SEV: Add KVM_SEV_SNP_LAUNCH_UPDATE command") Signed-off-by: Dan Carpenter <[email protected]> Message-ID: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 7c626ce commit 92b6c2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/svm/sev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2276,7 +2276,7 @@ static int sev_gmem_post_populate(struct kvm *kvm, gfn_t gfn_start, kvm_pfn_t pf
22762276

22772277
for (gfn = gfn_start, i = 0; gfn < gfn_start + npages; gfn++, i++) {
22782278
struct sev_data_snp_launch_update fw_args = {0};
2279-
bool assigned;
2279+
bool assigned = false;
22802280
int level;
22812281

22822282
ret = snp_lookup_rmpentry((u64)pfn + i, &assigned, &level);

0 commit comments

Comments
 (0)