aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/core')
-rw-r--r--drivers/infiniband/core/uverbs_cmd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index a0ceb1cbed52..2e959acf2ff1 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -396,6 +396,14 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file,
396 if ((cmd.start & ~PAGE_MASK) != (cmd.hca_va & ~PAGE_MASK)) 396 if ((cmd.start & ~PAGE_MASK) != (cmd.hca_va & ~PAGE_MASK))
397 return -EINVAL; 397 return -EINVAL;
398 398
399 /*
400 * Local write permission is required if remote write or
401 * remote atomic permission is also requested.
402 */
403 if (cmd.access_flags & (IB_ACCESS_REMOTE_ATOMIC | IB_ACCESS_REMOTE_WRITE) &&
404 !(cmd.access_flags & IB_ACCESS_LOCAL_WRITE))
405 return -EINVAL;
406
399 obj = kmalloc(sizeof *obj, GFP_KERNEL); 407 obj = kmalloc(sizeof *obj, GFP_KERNEL);
400 if (!obj) 408 if (!obj)
401 return -ENOMEM; 409 return -ENOMEM;