projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca2f30a
)
IB/qib: Prevent context loss
author
Ira Weiny
<ira.weiny@intel.com>
Thu, 9 Jun 2016 14:51:39 +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/qib/qib_file_ops.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/infiniband/hw/qib/qib_file_ops.c
b/drivers/infiniband/hw/qib/qib_file_ops.c
index ff946d5f59e4071606ebc00fff43df5a56dde2f6..382466a90da7331e4492fab59d60bf904db36df1 100644
(file)
--- a/
drivers/infiniband/hw/qib/qib_file_ops.c
+++ b/
drivers/infiniband/hw/qib/qib_file_ops.c
@@
-2178,6
+2178,11
@@
static ssize_t qib_write(struct file *fp, const char __user *data,
switch (cmd.type) {
case QIB_CMD_ASSIGN_CTXT:
+ if (rcd) {
+ ret = -EINVAL;
+ goto bail;
+ }
+
ret = qib_assign_ctxt(fp, &cmd.cmd.user_info);
if (ret)
goto bail;