提交 5e9ef246 编写于 作者: I Ira Weiny 提交者: Doug Ledford

IB/qib: Prevent context loss

If a context has already been assigned to an FD, prevent
another assignment.
Reviewed-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: NIra Weiny <ira.weiny@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 ca2f30a0
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册