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: 2bde9b3ec8 ("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>
This commit is contained in:
Cédric Le Goater 2019-05-09 14:33:44 +02:00 коммит произвёл Paul Mackerras
Родитель 3f8cb76c80
Коммит 4894fbcce8
1 изменённых файлов: 0 добавлений и 6 удалений

Просмотреть файл

@ -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);