powerpc kvm: use fdget
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 30 Aug 2013 19:04:22 +0000 (15:04 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 4 Sep 2013 03:04:45 +0000 (23:04 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/powerpc/kvm/powerpc.c

index 6316ee336e888e22636f557d1623c54b30d7a207..aca2e8f2e33fdb32fd32f3106ec6187fa3f78bed 100644 (file)
@@ -823,39 +823,39 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
 #endif
 #ifdef CONFIG_KVM_MPIC
        case KVM_CAP_IRQ_MPIC: {
-               struct file *filp;
+               struct fd f;
                struct kvm_device *dev;
 
                r = -EBADF;
-               filp = fget(cap->args[0]);
-               if (!filp)
+               f = fdget(cap->args[0]);
+               if (!f.file)
                        break;
 
                r = -EPERM;
-               dev = kvm_device_from_filp(filp);
+               dev = kvm_device_from_filp(f.file);
                if (dev)
                        r = kvmppc_mpic_connect_vcpu(dev, vcpu, cap->args[1]);
 
-               fput(filp);
+               fdput(f);
                break;
        }
 #endif
 #ifdef CONFIG_KVM_XICS
        case KVM_CAP_IRQ_XICS: {
-               struct file *filp;
+               struct fd f;
                struct kvm_device *dev;
 
                r = -EBADF;
-               filp = fget(cap->args[0]);
-               if (!filp)
+               f = fdget(cap->args[0]);
+               if (!f.file)
                        break;
 
                r = -EPERM;
-               dev = kvm_device_from_filp(filp);
+               dev = kvm_device_from_filp(f.file);
                if (dev)
                        r = kvmppc_xics_connect_vcpu(dev, vcpu, cap->args[1]);
 
-               fput(filp);
+               fdput(f);
                break;
        }
 #endif /* CONFIG_KVM_XICS */