Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
		}