Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1252391pxa; Thu, 20 Aug 2020 06:49:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0I1ox1SKzMw/3snFYi/uKavYPzem91fFPJZ9YSuu0YngcGoE1F/wBwf4WfCfcNQfz3Dl4 X-Received: by 2002:a05:6402:16:: with SMTP id d22mr3053498edu.175.1597931381470; Thu, 20 Aug 2020 06:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931381; cv=none; d=google.com; s=arc-20160816; b=gmEjGosfp48kj4Mh6ot8gqTb88tk3Q0ox386q7vqc58wdnMf0t0+fS8/7PeHBYNbKn y+C3jCsvL/z8dsrkajlA5I7ZsEsvU/W5+Mg0EH+z/kmPeh/ieET2KYgJYtpOQMvBDLSp Izwz51S1Rs4zC1xJOJbzEOvdBWFYFdmD5gsWIJHJic97YdmYV+xc/Quyc84k6ByLLfH7 5Br5K2N7v/rt27KRX1xW2XgmojQhr/n0hYgLgBSrS/Sytmc+0jlLZSmMYzwCzPYKL3lF wjPE+BSlirNeksZdaSvnGmMfKW0zMT+GP5vD7JSX+Lh8MYqsiwpDtCg8GqHtr93E4+NX HIAQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WZSZezxSCR/vXu6/CKWZgrvWii8dPw3p1arNj1NLG4w=; b=lXlSzEbZbtDQJDmeiIjkhuzxaDN5rOAkPxGmwMGndpqweSyub1OiMiR+AMgyHF1n4D JfNTJ0C2OrGuoBsBYp6c7loFoEtylGIujtP3mhLbbzx7Upv6PkKzkGFw+7TI9p6LdcFE fWyLDBnPJi9z0wEWV7BNCDLZkWXX823c3hsovW2rj6nkcMBTDvF10bjvoBB6G9iBcGOw Uq15mhLSnOWYRMWTb36W41mbLXO8OvabjlD5T0IhI1FVIEbW8gj3Kl3AC5qqGr46t8Vl Y/ozYix0IuL4yrcuMoeLcuYIZFDuneY+yPBW7vlfOacky3EdnGzsd/xztS0WEiyFLJ1u Zsiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KibHYYbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si1206290eja.259.2020.08.20.06.49.17; Thu, 20 Aug 2020 06:49:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KibHYYbG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729701AbgHTNol (ORCPT + 99 others); Thu, 20 Aug 2020 09:44:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:39390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728043AbgHTJ3F (ORCPT ); Thu, 20 Aug 2020 05:29:05 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7B8A2075E; Thu, 20 Aug 2020 09:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915745; bh=ifY08RktxRwj5+E/Tr2wAaVytBAVd0Gw42ZhtSRJAxE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KibHYYbGH7UxkXmCssSaaDPSYVsVjliLmSqvIc4+sGb0ToqATVvpxr70K0q2HzlAm vVQcr9twatlXhq3b+KF11DhOlXfUb6Uw7YYlG/pyF8GVUCprEhEscw45YErlHjY4ZL andHM43jZHEGYB5AZs8dEEdPU8y5toBcUStUa7Wc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiushi Wu , Mathew King , Enric Balletbo i Serra , Sasha Levin Subject: [PATCH 5.8 119/232] platform/chrome: cros_ec_ishtp: Fix a double-unlock issue Date: Thu, 20 Aug 2020 11:19:30 +0200 Message-Id: <20200820091618.583013949@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qiushi Wu [ Upstream commit aaa3cbbac326c95308e315f1ab964a3369c4d07d ] In function cros_ec_ishtp_probe(), "up_write" is already called before function "cros_ec_dev_init". But "up_write" will be called again after the calling of the function "cros_ec_dev_init" failed. Thus add a call of the function “down_write” in this if branch for the completion of the exception handling. Fixes: 26a14267aff2 ("platform/chrome: Add ChromeOS EC ISHTP driver") Signed-off-by: Qiushi Wu Tested-by: Mathew King Signed-off-by: Enric Balletbo i Serra Signed-off-by: Sasha Levin --- drivers/platform/chrome/cros_ec_ishtp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c index ed794a7ddba9b..81364029af367 100644 --- a/drivers/platform/chrome/cros_ec_ishtp.c +++ b/drivers/platform/chrome/cros_ec_ishtp.c @@ -681,8 +681,10 @@ static int cros_ec_ishtp_probe(struct ishtp_cl_device *cl_device) /* Register croc_ec_dev mfd */ rv = cros_ec_dev_init(client_data); - if (rv) + if (rv) { + down_write(&init_lock); goto end_cros_ec_dev_init_error; + } return 0; -- 2.25.1