]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
KVM: SVM: Fix sev_pin_memory() error checks in SEV migration utilities
authorSean Christopherson <seanjc@google.com>
Thu, 6 May 2021 17:58:26 +0000 (10:58 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 15 Jul 2021 14:19:43 +0000 (10:19 -0400)
commitc7a1b2b678c54ac19320daf525038d0e2e43ca7c
tree9c43fa51d68fa6e5f7c4cdaeb8b909817067f814
parentb4a693924aab93f3747465b2261add46c82c3220
KVM: SVM: Fix sev_pin_memory() error checks in SEV migration utilities

Use IS_ERR() instead of checking for a NULL pointer when querying for
sev_pin_memory() failures.  sev_pin_memory() always returns an error code
cast to a pointer, or a valid pointer; it never returns NULL.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Steve Rutherford <srutherford@google.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Ashish Kalra <ashish.kalra@amd.com>
Fixes: d3d1af85e2c7 ("KVM: SVM: Add KVM_SEND_UPDATE_DATA command")
Fixes: 15fb7de1a7f5 ("KVM: SVM: Add KVM_SEV_RECEIVE_UPDATE_DATA command")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210506175826.2166383-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c