summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/ocxl/file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c
index 33ae46ce0a8a..e6a607488f8a 100644
--- a/drivers/misc/ocxl/file.c
+++ b/drivers/misc/ocxl/file.c
@@ -139,8 +139,10 @@ static long afu_ioctl_enable_p9_wait(struct ocxl_context *ctx,
// Locks both status & tidr
mutex_lock(&ctx->status_mutex);
if (!ctx->tidr) {
- if (set_thread_tidr(current))
+ if (set_thread_tidr(current)) {
+ mutex_unlock(&ctx->status_mutex);
return -ENOENT;
+ }
ctx->tidr = current->thread.tidr;
}