Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3694717pxb; Mon, 21 Feb 2022 03:56:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzX07V86eDsQrW0U9jrYFxrFsrW64pFacrTlwBXb44CifEi+cjjHdjHQAT+hQ7w3dcRdzZt X-Received: by 2002:a63:c115:0:b0:373:1840:5cbf with SMTP id w21-20020a63c115000000b0037318405cbfmr15850873pgf.382.1645444587967; Mon, 21 Feb 2022 03:56:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645444587; cv=none; d=google.com; s=arc-20160816; b=U1t57uV7/CrXg/SZ5LwU+u03Ef++30rCCL3vNORzx/LKw3g+i5MgKp6q8lXexnrd3/ fm3SY7ZtiSoG6hZjdwF09ZPlvYdKXW9LKaW1zhPMOryJPPo3ZHYRYIaIzUg6eV++H47e kKv9oHbycqo02Sx1NGT7vczcsViPHn/JMCwQoTWAgij7clDBtqKR2Z6HzuwOaRZ++Hwx jlm4/KE2fTvZRKREO21Rl/xoIpqtcKna9oPyvUyrJuRS7ii7XxCGAC78yZ4ZWxfLvt3s 4yY9AgyBhSu4FL1Zewqxa4BcZ6nU40MqyLZK5wP/p4KC4dOgaf4FjcUE5zMDhR1Wa0zB LrMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MUa1nwv2kXf+wuwHOLWIS3RxXHMCEv3nGoxbt/aXG/g=; b=nH6cWs88/j6YD5EPuIGEj/iiTU4udVJ1afQVDvIBStHQ3H2cg3gdvPx9HF6FvJ4kyp 5fk73BO7Id0M1mBRaGVxhBlPp5V1U9dVqVM6NFg8w0VUSwrgbgaHBB/4Grg3xS3wY7h9 tbDFmnmCQzRL5eABhtvs1Hg68NfgUOdMBoBdV0EtfUGp8534OgEElHWBeW97g10bypWU 0L7E5b+TE1M9OxQBcvhTMcrO4fdujgS8vv99MUijL/nGuoBIK8G4Tt5vwikyfRuDay39 hO9I5DgBlDl9+4hwFMa68xXJyDIPrjJxgiaJN4JmCL1w+ez2kK7jUOal1/lbbkQvVMnm +CIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eclIVfU4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a64si17265049pge.230.2022.02.21.03.56.14; Mon, 21 Feb 2022 03:56:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eclIVfU4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347861AbiBUJNa (ORCPT + 99 others); Mon, 21 Feb 2022 04:13:30 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347840AbiBUJI7 (ORCPT ); Mon, 21 Feb 2022 04:08:59 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E983C121; Mon, 21 Feb 2022 01:01:10 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 47BCA611D0; Mon, 21 Feb 2022 09:01:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24555C340E9; Mon, 21 Feb 2022 09:01:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434069; bh=FHa1Kgt/KDt63TTXl8ZR/xZPmr5N3APcqR18hi6Jeh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eclIVfU4ogweqn84ufAspcUZQMmaQF0AGEFVMtXa+Tj57xgckf6ms3Ydiuuy0SzZG lSLhUF3uUrtPQ9DhTQkdriv1W2D8diuOcRrI1mVl9ylnNlriZpWShdef4JlltMQpnk i0yveGiNLKNaRbO3nKHr7sQZLHBHKN2QDg4Hs58Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Machek , Christian Eggers , Miquel Raynal Subject: [PATCH 5.4 51/80] mtd: rawnand: gpmi: dont leak PM reference in error path Date: Mon, 21 Feb 2022 09:49:31 +0100 Message-Id: <20220221084917.251541092@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christian Eggers commit 9161f365c91614e5a3f5c6dcc44c3b1b33bc59c0 upstream. If gpmi_nfc_apply_timings() fails, the PM runtime usage counter must be dropped. Reported-by: Pavel Machek Fixes: f53d4c109a66 ("mtd: rawnand: gpmi: Add ERR007117 protection for nfc_apply_timings") Signed-off-by: Christian Eggers Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220125081619.6286-1-ceggers@arri.de Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c @@ -2442,7 +2442,7 @@ static int gpmi_nfc_exec_op(struct nand_ this->hw.must_apply_timings = false; ret = gpmi_nfc_apply_timings(this); if (ret) - return ret; + goto out_pm; } dev_dbg(this->dev, "%s: %d instructions\n", __func__, op->ninstrs); @@ -2571,6 +2571,7 @@ unmap: this->bch = false; +out_pm: pm_runtime_mark_last_busy(this->dev); pm_runtime_put_autosuspend(this->dev);