Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320706
b: refs/heads/master
c: 0764c76
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier committed Jul 27, 2012
1 parent 0e92ab3 commit ade2b9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4e289045286c5f20d7d8f86b18679bad9e9a2003
refs/heads/master: 0764c76ecb06987749bce49657e473e6605f09c4
19 changes: 7 additions & 12 deletions trunk/drivers/infiniband/core/ucma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1002,23 +1002,18 @@ static ssize_t ucma_set_option(struct ucma_file *file, const char __user *inbuf,
if (IS_ERR(ctx))
return PTR_ERR(ctx);

optval = kmalloc(cmd.optlen, GFP_KERNEL);
if (!optval) {
ret = -ENOMEM;
goto out1;
}

if (copy_from_user(optval, (void __user *) (unsigned long) cmd.optval,
cmd.optlen)) {
ret = -EFAULT;
goto out2;
optval = memdup_user((void __user *) (unsigned long) cmd.optval,
cmd.optlen);
if (IS_ERR(optval)) {
ret = PTR_ERR(optval);
goto out;
}

ret = ucma_set_option_level(ctx, cmd.level, cmd.optname, optval,
cmd.optlen);
out2:
kfree(optval);
out1:

out:
ucma_put_ctx(ctx);
return ret;
}
Expand Down

0 comments on commit ade2b9a

Please sign in to comment.