Commit 2e5c93d6 authored by Wei Yongjun's avatar Wei Yongjun Committed by Michael Ellerman

ocxl: Fix missing unlock on error in afu_ioctl_enable_p9_wait()

Add the missing unlock before return from function
afu_ioctl_enable_p9_wait() in the error handling case.

Fixes: e948e06f ("ocxl: Expose the thread_id needed for wait on POWER9")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarAlastair D'Silva <alastair@d-silva.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent b0c4acb1
...@@ -139,8 +139,10 @@ static long afu_ioctl_enable_p9_wait(struct ocxl_context *ctx, ...@@ -139,8 +139,10 @@ static long afu_ioctl_enable_p9_wait(struct ocxl_context *ctx,
// Locks both status & tidr // Locks both status & tidr
mutex_lock(&ctx->status_mutex); mutex_lock(&ctx->status_mutex);
if (!ctx->tidr) { if (!ctx->tidr) {
if (set_thread_tidr(current)) if (set_thread_tidr(current)) {
mutex_unlock(&ctx->status_mutex);
return -ENOENT; return -ENOENT;
}
ctx->tidr = current->thread.tidr; ctx->tidr = current->thread.tidr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment