lkml.org 
[lkml]   [2018]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -next] ocxl: Fix missing unlock on error in afu_ioctl_enable_p9_wait()
From
Date


Le 05/06/2018 à 11:16, Wei Yongjun a écrit :
> 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>
> ---
> drivers/misc/ocxl/file.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c
> index 33ae46c..e6a6074 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;
> + }

O_o Thanks for fixing it

Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>


> ctx->tidr = current->thread.tidr;
> }
>

\
 
 \ /
  Last update: 2018-06-05 14:57    [W:0.032 / U:9.872 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site