diff options
author | Cédric Le Goater <clg@kaod.org> | 2019-05-09 14:33:44 +0200 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2019-05-14 04:06:03 +0200 |
commit | 4894fbcce856635c9ab79f44e50826e86bb92110 (patch) | |
tree | 30635bbe00a4dd179dd60c63075c8c5bacd25f8e /virt | |
parent | KVM: PPC: Book3S HV: XIVE: Fix spelling mistake "acessing" -> "accessing" (diff) | |
download | linux-4894fbcce856635c9ab79f44e50826e86bb92110.tar.xz linux-4894fbcce856635c9ab79f44e50826e86bb92110.zip |
KVM: PPC: Book3S: Remove useless checks in 'release' method of KVM device
There is no need to test for the device pointer validity when releasing
a KVM device. The file descriptor should identify it safely.
Fixes: 2bde9b3ec8bd ("KVM: Introduce a 'release' method for KVM devices")
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index ea2619d5ca98..37149433c07a 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2938,12 +2938,6 @@ static int kvm_device_release(struct inode *inode, struct file *filp) struct kvm_device *dev = filp->private_data; struct kvm *kvm = dev->kvm; - if (!dev) - return -ENODEV; - - if (dev->kvm != kvm) - return -EPERM; - if (dev->ops->release) { mutex_lock(&kvm->lock); list_del(&dev->vm_node); |