um: Do not unlock mutex that is not hold.

Return error instead of trying to unlock a mutex that is not hold.

Signed-off-by: Daniel Walter <dwalter@google.com>
Reviewed-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
Daniel Walter 2019-04-02 10:43:32 +02:00 committed by Richard Weinberger
parent 91e1e547ab
commit 9ca55299f2

View file

@ -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);