提交 456295e2 编写于 作者: I Ian Munsie 提交者: Michael Ellerman

cxl: Fix leaking interrupts if attach process fails

In this particular error path we have already allocated the AFU
interrupts, but have not yet set the status to STARTED. The detach
context code will only attempt to release the interrupts if the context
is in state STARTED, so in this case the interrupts would remain
allocated.

This patch releases the AFU interrupts immediately if the attach call
fails to prevent them leaking.
Signed-off-by: NIan Munsie <imunsie@au1.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 e144d4ed
...@@ -185,8 +185,10 @@ static long afu_ioctl_start_work(struct cxl_context *ctx, ...@@ -185,8 +185,10 @@ static long afu_ioctl_start_work(struct cxl_context *ctx,
ctx->pid = get_pid(get_task_pid(current, PIDTYPE_PID)); ctx->pid = get_pid(get_task_pid(current, PIDTYPE_PID));
if ((rc = cxl_attach_process(ctx, false, work.work_element_descriptor, if ((rc = cxl_attach_process(ctx, false, work.work_element_descriptor,
amr))) amr))) {
afu_release_irqs(ctx);
goto out; goto out;
}
ctx->status = STARTED; ctx->status = STARTED;
rc = 0; rc = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册