Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp462664yba; Fri, 5 Apr 2019 10:03:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUy1S6bp24zK7gtq1eNvhxJsTyEnrzlQuIIwGOBOXGbZPS6YoVPSXXPF/+VVr6hy0HxtqY X-Received: by 2002:a17:902:e110:: with SMTP id cc16mr14212027plb.147.1554483823399; Fri, 05 Apr 2019 10:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554483823; cv=none; d=google.com; s=arc-20160816; b=aFmoOUMwUYuIvY52Z/lbaikBkGIzYc417HQK6PQ2qBLDz8yMzYAz0borCXiyF1CNAk cDaaLG15xtxhLFZXxJfN/U/qgpBgv4FGM4AzMAmQqI5HbdT9r7bH2TzgiQIRLeLd8LVC N3Tn/ymdKCu+i+6Gh6GhIvS8G3q90jV5xQRnFU7C8ktmXDBR+Vf8wqM7ZoVBnyt6WTTC EP7zB0nVzsAnNZ3DkSqgNsN4upMpNGnFe24i0pQGdJIO0IhTNcNl59TXvQu4oRrkNPic Vf+4Vxk7z8wDt5r1Ttym3kCKR5J1Lk8jcpA3ygTEtAy8ZbeR7hlnCY+n+jPqYkDj22Y6 IAaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=xhRb8t117e9h2pLyrP1jP6sXC0xwI58Ek6y4zVJrfnI=; b=PCl6/5W8TWmUe77uzKCNd5BMQhqP6JtXomMuU42ysin6BVVb1VoFIKjS8rxLZgiVfd vguo2IfTZ9CKEnifgk1Jbes9DRd0YW2i3+0jgiMdSv4LFRLkhNf8YUK4duYDiBnMB1JL 2ZZZGWU2DcjRPQ9tKHZvkyLIzLscJtxZgFZi6mIwl1v+KiUpOPFZ6P4TPhvn4Ysfc9VO YBLnKEHdh7zFP8OFoI1IoLk+wynE31+eXmPLmkRs5yTdfcaafolQeN2UJcjyWJ4C99VT jEN33i+OaGISrlB3eJZ/LGH+BBviOzG0XtdCyrqeKrITHN6+Qg9+b1xhqFHq5ykS7mV0 G5wg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si20153087pfe.141.2019.04.05.10.03.27; Fri, 05 Apr 2019 10:03:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731312AbfDERBU (ORCPT + 99 others); Fri, 5 Apr 2019 13:01:20 -0400 Received: from ivanoab6.miniserver.com ([5.153.251.140]:56746 "EHLO www.kot-begemot.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730492AbfDERBU (ORCPT ); Fri, 5 Apr 2019 13:01:20 -0400 X-Greylist: delayed 2626 seconds by postgrey-1.27 at vger.kernel.org; Fri, 05 Apr 2019 13:01:19 EDT Received: from [192.168.17.6] (helo=jain.kot-begemot.co.uk) by www.kot-begemot.co.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hCRX0-0000Ds-Gd; Fri, 05 Apr 2019 16:17:30 +0000 Received: from jain.kot-begemot.co.uk ([192.168.3.3]) by jain.kot-begemot.co.uk with esmtp (Exim 4.89) (envelope-from ) id 1hCRWx-0001Gf-Pu; Fri, 05 Apr 2019 17:17:30 +0100 Subject: Re: [PATCH] um: Do not unlock mutex that is not hold. To: Daniel Walter , richard@nod.at, linux-um@lists.infradead.org Cc: linux-kernel@vger.kernel.org References: <20190402084332.88965-1-dwalter@google.com> From: Anton Ivanov Message-ID: Date: Fri, 5 Apr 2019 17:17:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190402084332.88965-1-dwalter@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 X-Spam-Score: -1.0 X-Clacks-Overhead: GNU Terry Pratchett Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 Acked-by: Anton Ivanov -- Anton R. Ivanov https://www.kot-begemot.co.uk/