Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp854042pxk; Thu, 17 Sep 2020 19:09:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDNTpF6ryjBfx5mirpBm4i3FMeynVPaJZuDIBqa+rEHdDTkpgTeMfUv7yJnbeHT7Tc2xVc X-Received: by 2002:a05:6402:1d0f:: with SMTP id dg15mr37314178edb.342.1600394994239; Thu, 17 Sep 2020 19:09:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600394994; cv=none; d=google.com; s=arc-20160816; b=PspPNldf8vukwPY2HcaYV2P/ih/oB8M8L6qewvb/chy6Gx3nhrWL+35Vz5StiUM2sT uIlh8WylMODOFy1i3E3UNu8sMpjAu8pLzUIhUfXrdA8XHviDtrur7V4hlB6A3x2I3NbV dQq+/LcKawiJbr5MSv4AW6kpSYTTQBFqBEUlcRUotjeFlO6Ymua0BdY9cjU7XVB8tz+s iHp4NhQ4dRsLhO5EoX64zgoyuEymBSSgDvK3vh6VIgBh5K+WyS0qN/LVJgdv9jGdXyr7 p6IpsvO4RT0LHOUWOvVSYUI3AgKU8FU+reiZpvNujSriarrGHpOWiLAfTNjrLl2os8t5 +3CA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AX+vA/kUDrw8OYaxLEb5iR0RB/OJVKTKiIHzMJctTNE=; b=J5EdU4dGOCAabeYn+Em+mYR/R+JQglZoD64qLX/6M0eVG9FzH/IePSY0Gkmq2treK7 OiYI6IBwoYm5DEzXTkgsVzUEFX0/ThqVTzbc6bZG4arYyCjQwiVbivc/Z1SwurgnicnE snmhMXnLUP8wzmOyDTE5N0uxnZ7U2+htoBzYYws8m57bgTv7+mAEtOYXamfMo2hFnj/j D3YAYsh3RJBs/4WoqTo8EZD/EsY6IvPKMDMTZ2NOOe5t2VJ09gj1XM+l1Ian+mttw0g+ fQdZ4FBSGSlgym+OE8B8hA0vel2MY/Xx+4/midxB4pNTamLNNi0C1jJu28tUKkIXkU6x VXOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=F02K7Ehk; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si1183393eji.298.2020.09.17.19.09.30; Thu, 17 Sep 2020 19:09:54 -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=F02K7Ehk; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727946AbgIRCHd (ORCPT + 99 others); Thu, 17 Sep 2020 22:07:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:57758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727927AbgIRCH0 (ORCPT ); Thu, 17 Sep 2020 22:07:26 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C11C239A1; Fri, 18 Sep 2020 02:07:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394846; bh=XxxrY+0LVUDKUPM63mF0qJ4HNb8rZ1kPsW2WuUNjq5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F02K7EhkLx1vWvVGfAzlsmHxoZ5/TRnm/90+BaHtWqWVEe4DU3DbuM9F4JLJxuW9h ifgofcbrY30JNv8jAPBFRiw0BOTBXfRSP9j34JosqdIzDjE1cJ+tKi2Akmk+RLMrLZ JLKEZ9nKmbuMLIKSvCcAqn2dur0y1VLDMK5KbtNg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dinghao Liu , Miquel Raynal , Sasha Levin , linux-mtd@lists.infradead.org Subject: [PATCH AUTOSEL 5.4 303/330] mtd: rawnand: omap_elm: Fix runtime PM imbalance on error Date: Thu, 17 Sep 2020 22:00:43 -0400 Message-Id: <20200918020110.2063155-303-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit 37f7212148cf1d796135cdf8d0c7fee13067674b ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200522104008.28340-1-dinghao.liu@zju.edu.cn Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/omap_elm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/raw/omap_elm.c b/drivers/mtd/nand/raw/omap_elm.c index 5502ffbdd1e6d..6e0e31eab7cce 100644 --- a/drivers/mtd/nand/raw/omap_elm.c +++ b/drivers/mtd/nand/raw/omap_elm.c @@ -411,6 +411,7 @@ static int elm_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); if (pm_runtime_get_sync(&pdev->dev) < 0) { ret = -EINVAL; + pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); dev_err(&pdev->dev, "can't enable clock\n"); return ret; -- 2.25.1