From 4894fbcce856635c9ab79f44e50826e86bb92110 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Le=20Goater?= Date: Thu, 9 May 2019 14:33:44 +0200 Subject: [PATCH] KVM: PPC: Book3S: Remove useless checks in 'release' method of KVM device MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Alexey Kardashevskiy Signed-off-by: Paul Mackerras --- virt/kvm/kvm_main.c | 6 ------ 1 file changed, 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); -- 2.30.2