提交 4894fbcc 编写于 作者: C Cédric Le Goater 提交者: Paul Mackerras

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: 2bde9b3e ("KVM: Introduce a 'release' method for KVM devices")
Signed-off-by: NCédric Le Goater <clg@kaod.org>
Reviewed-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: NPaul Mackerras <paulus@ozlabs.org>
上级 3f8cb76c
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册