]> Pileus Git - ~andy/linux/blobdiff - drivers/infiniband/core/ucma.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[~andy/linux] / drivers / infiniband / core / ucma.c
index 055ed59838dca128eef4986a9b3186a1f0588b84..2709ff581392f1dcd928c15356df3a85d58ec36b 100644 (file)
@@ -310,7 +310,6 @@ static ssize_t ucma_get_event(struct ucma_file *file, const char __user *inbuf,
        struct rdma_ucm_get_event cmd;
        struct ucma_event *uevent;
        int ret = 0;
-       DEFINE_WAIT(wait);
 
        if (out_len < sizeof uevent->resp)
                return -ENOSPC;
@@ -1184,7 +1183,7 @@ static ssize_t ucma_migrate_id(struct ucma_file *new_file,
        struct rdma_ucm_migrate_id cmd;
        struct rdma_ucm_migrate_resp resp;
        struct ucma_context *ctx;
-       struct file *filp;
+       struct fd f;
        struct ucma_file *cur_file;
        int ret = 0;
 
@@ -1192,12 +1191,12 @@ static ssize_t ucma_migrate_id(struct ucma_file *new_file,
                return -EFAULT;
 
        /* Get current fd to protect against it being closed */
-       filp = fget(cmd.fd);
-       if (!filp)
+       f = fdget(cmd.fd);
+       if (!f.file)
                return -ENOENT;
 
        /* Validate current fd and prevent destruction of id. */
-       ctx = ucma_get_ctx(filp->private_data, cmd.id);
+       ctx = ucma_get_ctx(f.file->private_data, cmd.id);
        if (IS_ERR(ctx)) {
                ret = PTR_ERR(ctx);
                goto file_put;
@@ -1231,7 +1230,7 @@ response:
 
        ucma_put_ctx(ctx);
 file_put:
-       fput(filp);
+       fdput(f);
        return ret;
 }