aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/cxl/context.c5
-rw-r--r--drivers/misc/cxl/file.c1
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/cxl/context.c b/drivers/misc/cxl/context.c
index 7d857b7d686d..2a4c80ac322a 100644
--- a/drivers/misc/cxl/context.c
+++ b/drivers/misc/cxl/context.c
@@ -186,6 +186,9 @@ int __detach_context(struct cxl_context *ctx)
return -EBUSY;
WARN_ON(cxl_detach_process(ctx));
+ flush_work(&ctx->fault_work); /* Only needed for dedicated process */
+ put_pid(ctx->pid);
+ cxl_ctx_put();
return 0;
}
@@ -204,7 +207,6 @@ void cxl_context_detach(struct cxl_context *ctx)
return;
afu_release_irqs(ctx, ctx);
- flush_work(&ctx->fault_work); /* Only needed for dedicated process */
wake_up_all(&ctx->wq);
}
@@ -245,7 +247,6 @@ static void reclaim_ctx(struct rcu_head *rcu)
free_page((u64)ctx->sstp);
ctx->sstp = NULL;
- put_pid(ctx->pid);
kfree(ctx);
}
diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c
index 676e2c8bc1ab..c16bd6fa06ed 100644
--- a/drivers/misc/cxl/file.c
+++ b/drivers/misc/cxl/file.c
@@ -128,7 +128,6 @@ static int afu_release(struct inode *inode, struct file *file)
*/
cxl_context_free(ctx);
- cxl_ctx_put();
return 0;
}