]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/infiniband/core/uverbs_main.c
switch simple cases of fget_light to fdget
[mirror_ubuntu-zesty-kernel.git] / drivers / infiniband / core / uverbs_main.c
index acf75c2cf7ef9f63e0840c4d6185e7133aada23d..6f2ce6fa98f8b0446d4ed45fabe7b3a67a49fcdb 100644 (file)
@@ -541,17 +541,15 @@ struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file,
 struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd)
 {
        struct ib_uverbs_event_file *ev_file = NULL;
-       struct file *filp;
-       int fput_needed;
+       struct fd f = fdget(fd);
 
-       filp = fget_light(fd, &fput_needed);
-       if (!filp)
+       if (!f.file)
                return NULL;
 
-       if (filp->f_op != &uverbs_event_fops)
+       if (f.file->f_op != &uverbs_event_fops)
                goto out;
 
-       ev_file = filp->private_data;
+       ev_file = f.file->private_data;
        if (ev_file->is_async) {
                ev_file = NULL;
                goto out;
@@ -560,7 +558,7 @@ struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd)
        kref_get(&ev_file->ref);
 
 out:
-       fput_light(filp, fput_needed);
+       fdput(f);
        return ev_file;
 }