Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1081685yba; Tue, 2 Apr 2019 01:44:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsjRGWWVrzkQhjhqV2jzMVAb+SG0lVTOnwSp9Nv4M2yw/Aqi1JMrE2NveIizrPY0j4vrZ6 X-Received: by 2002:a17:902:264:: with SMTP id 91mr1020841plc.184.1554194698428; Tue, 02 Apr 2019 01:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554194698; cv=none; d=google.com; s=arc-20160816; b=j4sVKW6NNe2Aw7oByydwrFFOIKqqc1TUdo3JsCuOKkDg4T4jTProBAt2+6YRyqhlUJ lm/O3+QVjBibSMooen+L6IDEWp0pguq2Ah3jU780Jw588ieJ5LN9dY0b/bGrCw8d9HIq LRYyhErk63jsJ40o43HNq3XgV3D59nSVBhMzxt1xav2LNYkRFX9pjQ4U2uv3lCL72Z7G LdefeEv2Y3zwBjEC1OHjyNEgajzLm97qAXJF/LrulW3jzHDaNWRnHUDNCDn5+6f6u/Mv 794OhaNlkK93JkyRypHr6nvf2bzUf3QI++QgM53NYu23lH5eflsw8o5+W0u+OYK4zu8T 8vxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=YPtcyQ7zvWu5qLoy1iT9x8FgtOoN/QVtwb/lGHQIFAs=; b=w/4sJeULP6xrP1PdFSplzPoZtcEpKMIcrzovHFDMaCKDcTx1A0e9Ffir9EXX/T7OjC tJ3II8vwl0/Gx/+hxSYndDWBXiBnCE4Qu+6J4l5asu41CmIbCdAJJ/s6+XV5IMwSI8NW 29np+QHS4Tw659GibV9fV3YDNJRIq+wiQU67m9FFU9ZO3Mhds9wKFo+V/5XvKwUjrcg7 UcRFeefaGuK/hIfHPB13rdEGsynkA+kBLf4jTp0Jemxt7S/D1nSbOVdv1LGB0kbMOOVI cLbBPqcXW3yQQVZZj+O8QV0b3JjqGde91z3eFhPIUDnALEPZWZO8NUzAwxXw66K0uXLy 4eZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ZhYK+ZvQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j24si6457438pll.286.2019.04.02.01.44.40; Tue, 02 Apr 2019 01:44:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ZhYK+ZvQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729602AbfDBIn6 (ORCPT + 99 others); Tue, 2 Apr 2019 04:43:58 -0400 Received: from mail-yw1-f74.google.com ([209.85.161.74]:33998 "EHLO mail-yw1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729526AbfDBIn4 (ORCPT ); Tue, 2 Apr 2019 04:43:56 -0400 Received: by mail-yw1-f74.google.com with SMTP id x66so9339327ywx.1 for ; Tue, 02 Apr 2019 01:43:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=YPtcyQ7zvWu5qLoy1iT9x8FgtOoN/QVtwb/lGHQIFAs=; b=ZhYK+ZvQuFFnK2fI2HOOixkuXTnBdgvis/wIXzSZ6kJPs21SgK16EwAYEul6CuOxuQ TkgS3LieWlcMAwyUsRpUKmjvkVoU10bQMT9QaX3ANTPpExRf76h+FCavaunIO5OIBeOs ccU82WKvSO+a4N6b7FLkqwlMhdBjvU1Z9JXQSwQc6K0LDWfmcF74yY4UXYwjxgt4Yupe V7WmdnP2p+jdVfRUkmcmvf922r1NpHiwr/DsQvdTOSq5KMEmqzY2G/XuMHVTvNdzIlhw TrMn0i+hDTUWKVL4Ks54nrv1wm/X2J7GZldEBqCq5nf1Tvq8GOMgsjxhPB9WnkHH+/aD I9PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=YPtcyQ7zvWu5qLoy1iT9x8FgtOoN/QVtwb/lGHQIFAs=; b=cpPJFPL/mLWpvYgibxTsDsZgp3y6r4M4fepf2aSSJYNLZC72JEusNX1fH44JLkmMiX JNK2OYTpxx47kmrSsZeTT8F/AHwAUl77PtYucNPo4vRw2bbay3L+8TIvWZmhL7Vaut7U fVofsqyp4gp+siCdPlxOwCSSOD5H0Yuj8izNaZsAueROHobo7QXkCMlF3X3K4E3sAAyI Ac84gJgDwreWJ9fEN89/knGxindKiaUJ9jV7LQlWotTZ2YALepVrY7aDKDDoZ6Qbyraa dU79iyTiLWIOzNtR35zZer82vf6LEiAyPjo5efeEkDcz9BspAf4dp89EIPYj6MdXzKjz zbsg== X-Gm-Message-State: APjAAAUTVc/LyxPLCiz5w1HzJGnc6Z0pdEiLHkNGvyrkpTuwfWWZPzo1 oCNR5zIEbc64QS2P6DrCbGyPpVydOZCV X-Received: by 2002:a25:911:: with SMTP id 17mr7338435ybj.67.1554194635745; Tue, 02 Apr 2019 01:43:55 -0700 (PDT) Date: Tue, 2 Apr 2019 10:43:32 +0200 Message-Id: <20190402084332.88965-1-dwalter@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog Subject: [PATCH] um: Do not unlock mutex that is not hold. From: Daniel Walter To: richard@nod.at, linux-um@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Daniel Walter Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return error instead of trying to unlock a mutex that is not hold. Signed-off-by: Daniel Walter --- 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); -- 2.21.0.392.gf8f6787159e-goog