diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-06-05 05:16:21 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-06-05 07:33:57 -0400 |
commit | 2e5c93d6bb2f7bc17eb82748943a1b9f6b068520 (patch) | |
tree | 1ce9a3ff3b86a8e95d36b181586941f22d462af1 /drivers/misc | |
parent | b0c4acb1dd7c653f78391661079af544429b1f22 (diff) |
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: e948e06fc63a ("ocxl: Expose the thread_id needed for wait on POWER9")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Alastair D'Silva <alastair@d-silva.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/ocxl/file.c | 4 |
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, | |||
139 | // Locks both status & tidr | 139 | // Locks both status & tidr |
140 | mutex_lock(&ctx->status_mutex); | 140 | mutex_lock(&ctx->status_mutex); |
141 | if (!ctx->tidr) { | 141 | if (!ctx->tidr) { |
142 | if (set_thread_tidr(current)) | 142 | if (set_thread_tidr(current)) { |
143 | mutex_unlock(&ctx->status_mutex); | ||
143 | return -ENOENT; | 144 | return -ENOENT; |
145 | } | ||
144 | 146 | ||
145 | ctx->tidr = current->thread.tidr; | 147 | ctx->tidr = current->thread.tidr; |
146 | } | 148 | } |