From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4435C433E1 for ; Thu, 20 Aug 2020 09:49:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B532D22B43 for ; Thu, 20 Aug 2020 09:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916999; bh=hRXr8wczIZrt0cJy0jW7KdOBS7YZgK4GYprUqa0cFWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SABWVokmX1gW+BcMa+yMvb4DnKUIfG/Q/TB5CFjnsjHWb2vDMvXUNf1jHV4TzFq7u BsM7ZAj5N8mD7YYY+5G3hqG+sxPs4FIg/K6MpCEdxE3arz//5eHtcKWjtXg53vcLjq 4wU70B4c4yN2gAlYYxwqhJX7CLnvWePoxaX41mcE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729668AbgHTJt6 (ORCPT ); Thu, 20 Aug 2020 05:49:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:55916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729674AbgHTJtg (ORCPT ); Thu, 20 Aug 2020 05:49:36 -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 8B99820724; Thu, 20 Aug 2020 09:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916976; bh=hRXr8wczIZrt0cJy0jW7KdOBS7YZgK4GYprUqa0cFWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E4lvxI6OP10eBmLNYe88BEVVNVSSBoz9mtSCYN52sLXJ3Ikeg6wuXk7L4JDwy7qeM DjrQcMyhxAUYIXoquY9cELzNp/gNR7ixyKtrSbMr+SmTLXEI5Sr0qAKatXV1BpvOzL CWGoAvSzfL10IZUZ1jw13Pc8wRVY65ZsAIWY7rHM= 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.4 081/152] platform/chrome: cros_ec_ishtp: Fix a double-unlock issue Date: Thu, 20 Aug 2020 11:20:48 +0200 Message-Id: <20200820091557.890172669@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091553.615456912@linuxfoundation.org> References: <20200820091553.615456912@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 25ca2c894b4de..ab0662a33b41a 100644 --- a/drivers/platform/chrome/cros_ec_ishtp.c +++ b/drivers/platform/chrome/cros_ec_ishtp.c @@ -645,8 +645,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