summaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorDaniel Walter <dwalter@google.com>2019-04-02 04:43:32 -0400
committerRichard Weinberger <richard@nod.at>2019-05-07 17:18:28 -0400
commit9ca55299f2ee0a2ccf41d99bfc02d5ad3118e03b (patch)
tree51c2a5a533c3561be6dbb4325ed520ae985903f0 /arch/um
parent91e1e547abcd88f1e23204e62e377aaa7c93a786 (diff)
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>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/drivers/ubd_kern.c4
1 files 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)
276 str++; 276 str++;
277 if(!strcmp(str, "sync")){ 277 if(!strcmp(str, "sync")){
278 global_openflags = of_sync(global_openflags); 278 global_openflags = of_sync(global_openflags);
279 goto out1; 279 return err;
280 } 280 }
281 281
282 err = -EINVAL; 282 err = -EINVAL;
283 major = simple_strtoul(str, &end, 0); 283 major = simple_strtoul(str, &end, 0);
284 if((*end != '\0') || (end == str)){ 284 if((*end != '\0') || (end == str)){
285 *error_out = "Didn't parse major number"; 285 *error_out = "Didn't parse major number";
286 goto out1; 286 return err;
287 } 287 }
288 288
289 mutex_lock(&ubd_lock); 289 mutex_lock(&ubd_lock);