Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2490397pxj; Mon, 10 May 2021 04:21:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTVc73Kxy2UqW4gozDEszZYzu3qWge4iJsKsJ9vDWjLr1jqFSmVAA+1ReSMv9Le7uVuPuT X-Received: by 2002:a05:6e02:13e1:: with SMTP id w1mr22851126ilj.181.1620645717028; Mon, 10 May 2021 04:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645717; cv=none; d=google.com; s=arc-20160816; b=B9kLLFeLVIkWLeBy4nAxjekfYjLr4G3qWEWI2CXvL7PrHILAUH4qT/ykSsWxydefMG gAlL+sUq65o/H/I8M8rSiIZm0E+HCOdhrCmdB8Hv+fRk5POg84/JdW5rs1V7RoHgsGlF WmP9BOFpflhm85fLNS3eb7U/fmQMGn/lIBab0RqJYcYSxg54XSOBw28fD8A3CwsmOqOJ 6iMDhsJxiIJOPYd+k3fg3O1OH1HCY03b8L9TZIpMQWScbW/jZIj8EbpwASSNYOLr9g24 bLQu4Jt2IHsG7Qr7CBbF8+ZO2C+sG4K1JDQdUMRMeCEorNaHnTeritEiYQBU7hq8WvTl b2bw== 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=Lf6SbsbqHdBOU8V2iiP/uo6hVX71dWEijshyuzbY/aA=; b=EOmp5+JaOE8nsfpPiFs9CIcGO7TOlrHNQsexavR+hGlZigAnQAZaBI30nq8GmNLFTb aRK4E+T5EBYnAZu8on91UTnf4xBNL5LYZ3YuHjPW5HqY1OuAjwP9KwkaA61fDTsYa8Vl Qv8bmJx7dUq/6n8GPYH83wujhsW2awFx9gmPfkoPnnhkOaruD+5rEuqTlhV7yGlwRDKT RkeYd3K7Ib6fvx8QL1+G5heI0SRkVj5qdFasRo11snb0A+2T0h2VcJXtfxaSw1zKf3UZ Sqqif4XLuJ1zTwBPPRUQr24RaLUEzOyFXpP2RGtMw9RxuJrPaHvip+n4TLY37Brgjb9/ y9EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rjOXQjNS; 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=pass (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 x20si1862727iov.56.2021.05.10.04.21.44; Mon, 10 May 2021 04:21:57 -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=@linuxfoundation.org header.s=korg header.b=rjOXQjNS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237896AbhEJLQ1 (ORCPT + 99 others); Mon, 10 May 2021 07:16:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:42240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233088AbhEJKvg (ORCPT ); Mon, 10 May 2021 06:51:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5C63E61A24; Mon, 10 May 2021 10:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643241; bh=OKwK4eLz2HroNbBIrmCzlVwA30oGt11q/lcXejRblVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rjOXQjNSugmNclpee+ZWb458IOWFEgsWttOkQ84IDG9wqq/t5DaRdfACzmmrUyhv2 iM87tEaNFib7z6HMlg/45tQcBY3qCmJHPGpnXhpV0OHNv+8Kn1l4LSRIcnNeJzpqQz UxKGC31nblPz81/fC4Vs7oL7CG8YUiKRkAXClgcM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Charles Keepax , Lee Jones , Sasha Levin Subject: [PATCH 5.10 201/299] mfd: arizona: Fix rumtime PM imbalance on error Date: Mon, 10 May 2021 12:19:58 +0200 Message-Id: <20210510102011.580783880@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit fe6df2b48043bbe1e852b2320501d3b169363c35 ] pm_runtime_get_sync() will increase the rumtime PM counter even it returns an error. Thus a pairing decrement is needed to prevent refcount leak. Fix this by replacing this API with pm_runtime_resume_and_get(), which will not change the runtime PM counter on error. Signed-off-by: Dinghao Liu Acked-by: Charles Keepax Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/mfd/arizona-irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c index 077d9ab112b7..d919ae9691e2 100644 --- a/drivers/mfd/arizona-irq.c +++ b/drivers/mfd/arizona-irq.c @@ -100,7 +100,7 @@ static irqreturn_t arizona_irq_thread(int irq, void *data) unsigned int val; int ret; - ret = pm_runtime_get_sync(arizona->dev); + ret = pm_runtime_resume_and_get(arizona->dev); if (ret < 0) { dev_err(arizona->dev, "Failed to resume device: %d\n", ret); return IRQ_NONE; -- 2.30.2