Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp874650pxk; Thu, 17 Sep 2020 19:59:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7vtJfPpVleBpPDl7G6jd6OSpGv52XdSc5cTD00hmgBJD/eM+qcNqNgIe7+s8Gdoncdo8Q X-Received: by 2002:a17:907:64d:: with SMTP id wq13mr33113285ejb.513.1600397974303; Thu, 17 Sep 2020 19:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397974; cv=none; d=google.com; s=arc-20160816; b=M7JeQnUCtbBEdShkudlIO/jMSYdUacaxDMM0AY1iAvl5luCb6bNaAtsSm9m5gNw/nq VtwjX27t1G5an7FbOIqYDicq5qE2tlW/Oc5fx+MZpbG1Wwlbi/UQQCVWR7ino0NwmXiC m9KK8ldzIF7V4pfuhU8wQbz/4C9gI8l3DnYf0p3r8Q3m0IkYzzuTdeTeaYA4xpuqK7w5 nMtP31gEWJIY6rEq/aZ1a7XpYdp0F23C+1ow80pcWW9SAJ+uI6G6MxvwZaDAF6NJPFo3 i2a5A2ULEKa2ZmYoudIJ2a0TwzHapTyXECfsNm6Dl2g+yw06Imfw3yPgB7gEse7gF1XA ueYg== 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=wjuEsK4ny6egrf1hzFKVogPAxY5NUuM1QVduAbK120Q=; b=COTgF3KgRU7tHy/ThQpW1sPg/AkIWYVRlZpVY1PL4Pzd9tWWQCJo72sCoeeaEGcDpI Px4kWlXBr+7Lc7lWgpvtCn1aNcau9/6o1OciQiTpvl8nyQwTfjmx9+0SEH+b+hQWVWmw x1BkI2kAu3noUh0RH8xKOMUKWixndI31H9rqh9QvseaiNItRZ3/pJBvM1LEqixBLCVVB SoFE3pzAhWfew/P7fmtom1DYQ9eGlGW9llrtrXhHRw+5uV7U3WHwtyZsI/9IDl/H+hNF b+4S29ON9/Mn6IzFgjIyl+8HLwT9DWAFKbqyF9vi1wPaxIL6BigCG95Mm3O/BWg5R4SV LGyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PuFjREZp; 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 j16si1420284edj.408.2020.09.17.19.59.11; Thu, 17 Sep 2020 19:59:34 -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=PuFjREZp; 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 S1728630AbgIRCzV (ORCPT + 99 others); Thu, 17 Sep 2020 22:55:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:57124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727850AbgIRCHI (ORCPT ); Thu, 17 Sep 2020 22:07:08 -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 588A023A05; Fri, 18 Sep 2020 02:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394823; bh=hHbpTSTPz6WKT02bLRF/XYFd6t/ARAuXZH0O+Ip4sXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PuFjREZpXAoUVdGoSyKUqsLlGmiZ0pE1eG+8v4SOv3YFBXPRFZa0stxMFgR8arkOf pxkVsY97i51RnFFGQHDiGWN98b261vbo/MidG0V4gddRaoJfxrnBD1f0WLNzZQ8yJx 4f03Aq3MlKh8GGY1KgP0lnJrzqg4lRzfnueYSoj0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dinghao Liu , Linus Walleij , Sasha Levin , linux-gpio@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 288/330] gpio: rcar: Fix runtime PM imbalance on error Date: Thu, 17 Sep 2020 22:00:28 -0400 Message-Id: <20200918020110.2063155-288-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 6f8cd246411575703d9312888b70705c396b53a9 ] 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 Link: https://lore.kernel.org/r/20200522080839.32612-1-dinghao.liu@zju.edu.cn Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/gpio/gpio-rcar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 187984d26f47a..f0b6c68e848e3 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -250,8 +250,10 @@ static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset) int error; error = pm_runtime_get_sync(p->dev); - if (error < 0) + if (error < 0) { + pm_runtime_put(p->dev); return error; + } error = pinctrl_gpio_request(chip->base + offset); if (error) -- 2.25.1