summaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2019-05-09 15:33:44 +0300
committerPaul Mackerras <paulus@ozlabs.org>2019-05-14 05:06:03 +0300
commit4894fbcce856635c9ab79f44e50826e86bb92110 (patch)
tree30635bbe00a4dd179dd60c63075c8c5bacd25f8e /virt
parent3f8cb76c80073912173406a3dd7670194c1a4003 (diff)
downloadlinux-4894fbcce856635c9ab79f44e50826e86bb92110.tar.xz
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.c6
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);