提交 2e5c93d6 编写于 作者: W Wei Yongjun 提交者: 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: NWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: NAlastair D'Silva <alastair@d-silva.org>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 b0c4acb1
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册