diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-01-07 09:28:37 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-01-07 09:28:37 -0800 |
commit | 24556728c305886b8bb05bf2ac7e20cf7db3e314 (patch) | |
tree | 4121378e0d2a656884aa7260532c4ef9c017ffb5 /arch/x86/kvm/debugfs.c | |
parent | 7a6043cc2e863ab45016622c30879e555523ee13 (diff) | |
parent | fffb5323780786c81ba005f8b8603d4a558aad28 (diff) |
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull kvm fixes from Paolo Bonzini:
"Two small fixes for x86:
- lockdep WARN due to missing lock nesting annotation
- NULL pointer dereference when accessing debugfs"
* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: x86: Check for rmaps allocation
KVM: SEV: Mark nested locking of kvm->lock
Diffstat (limited to 'arch/x86/kvm/debugfs.c')
-rw-r--r-- | arch/x86/kvm/debugfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/debugfs.c b/arch/x86/kvm/debugfs.c index 54a83a744538..f33c804a922a 100644 --- a/arch/x86/kvm/debugfs.c +++ b/arch/x86/kvm/debugfs.c @@ -95,6 +95,9 @@ static int kvm_mmu_rmaps_stat_show(struct seq_file *m, void *v) unsigned int *log[KVM_NR_PAGE_SIZES], *cur; int i, j, k, l, ret; + if (!kvm_memslots_have_rmaps(kvm)) + return 0; + ret = -ENOMEM; memset(log, 0, sizeof(log)); for (i = 0; i < KVM_NR_PAGE_SIZES; i++) { |