projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3c64a9
)
IB/hfi1: Prevent context loss
author
Ira Weiny
<ira.weiny@intel.com>
Thu, 9 Jun 2016 14:51:33 +0000
(07:51 -0700)
committer
Doug Ledford
<dledford@redhat.com>
Sat, 18 Jun 2016 00:11:26 +0000
(20:11 -0400)
If a context has already been assigned to an FD, prevent
another assignment.
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/file_ops.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/infiniband/hw/hfi1/file_ops.c
b/drivers/infiniband/hw/hfi1/file_ops.c
index 7a5b0e676cc7a4b1c1d9a65c76d66ba2f23a1f32..c702a009608f27a62b06b7ad4eb2d54914fab03b 100644
(file)
--- a/
drivers/infiniband/hw/hfi1/file_ops.c
+++ b/
drivers/infiniband/hw/hfi1/file_ops.c
@@
-203,6
+203,9
@@
static long hfi1_file_ioctl(struct file *fp, unsigned int cmd,
switch (cmd) {
case HFI1_IOCTL_ASSIGN_CTXT:
+ if (uctxt)
+ return -EINVAL;
+
if (copy_from_user(&uinfo,
(struct hfi1_user_info __user *)arg,
sizeof(uinfo)))