lkml.org 
[lkml]   [2019]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] um: Do not unlock mutex that is not hold.
From
Date


On 02/04/2019 09:43, Daniel Walter wrote:
> Return error instead of trying to unlock a mutex that is not hold.
>
> Signed-off-by: Daniel Walter <dwalter@google.com>
> ---
> arch/um/drivers/ubd_kern.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
> index aca09be2373e..33c1cd6a12ac 100644
> --- a/arch/um/drivers/ubd_kern.c
> +++ b/arch/um/drivers/ubd_kern.c
> @@ -276,14 +276,14 @@ static int ubd_setup_common(char *str, int *index_out, char **error_out)
> str++;
> if(!strcmp(str, "sync")){
> global_openflags = of_sync(global_openflags);
> - goto out1;
> + return err;
> }
>
> err = -EINVAL;
> major = simple_strtoul(str, &end, 0);
> if((*end != '\0') || (end == str)){
> *error_out = "Didn't parse major number";
> - goto out1;
> + return err;
> }
>
> mutex_lock(&ubd_lock);
>

Reviewed-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>

--
Anton R. Ivanov
https://www.kot-begemot.co.uk/

\
 
 \ /
  Last update: 2019-04-05 19:02    [W:0.036 / U:29.248 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site