Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2483530pxj; Mon, 10 May 2021 04:11:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD4aQTESs6aoORmZZfc3st/fqPCB6QLYLJF2uf19c1cocLDf7TH8D4VT1tcOgll2AyadPC X-Received: by 2002:a02:6d6c:: with SMTP id e44mr20711448jaf.81.1620645090854; Mon, 10 May 2021 04:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645090; cv=none; d=google.com; s=arc-20160816; b=fj4l0B794UdkcJkpY4dC0nrpOW9OSRRuyRG8+SCJvYmpao09yTC24Dsyag+qUK++7b VZSlMQLFOpt+KCLrNep7xeXVm7V4dIg8RY865VMVPtOh21QB3mLWq8elO/n1jY14mxwp TgGZbYOJLGqBp/yTAOorVE1wnrkv7tYpfFv/Lm80GJTCt6nSagFj5Afuib0di4Sv479K gGpbnNH0chJNl9Zb/QkGU3OPK3pgiWb9fhV41cbQfU6Lo7oh3pszNM91aRPXKFm3zrPh VFeHgT8gS6425essCqf+e4CUwuBdZJxY/YiMEYiujmldGBOHs7sFDuD1Ej0+y8HfGZ9O Rw3g== 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=GS9jj3yKfiZnks2xHEik4mO+qaea3XFEqJQcYZsv9Ac=; b=mzVnKT7RsyfnbG7AkVo6h0qWQUayCcPYz01rlDZQgFvoBWaMbWaptZ9yi4WqGonsoA z7b4laN+dWUmsmqlR27w3tZVt08Vvh62Kum24PiDr7cLEHkuStVeXbM8mwiX3ysXJVCG qcW8ig/BkLgntSGat8f6my/4ufQm0zRJS/LFp8hGDf7qIkWnSKT6VReqYJQUyz+IlWpP VK/ycT/09ouC2VI1OqWFDrmOWpNgwt95sqSSywH1hM7YDetnnmqR6DaDIdFVLj5THBEs NAnomqoJEZvfIHv/R+9h+0faSMtGde5rELBr2KEpDR4PMY6xczVRpYOxNW7qQyCryqzq fnSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Cwsvm1r+; 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 n4si15283304ion.59.2021.05.10.04.11.17; Mon, 10 May 2021 04:11:30 -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=Cwsvm1r+; 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 S234831AbhEJLJL (ORCPT + 99 others); Mon, 10 May 2021 07:09:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:41652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233202AbhEJKtt (ORCPT ); Mon, 10 May 2021 06:49:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 091B2619D4; Mon, 10 May 2021 10:38:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643108; bh=8JuOBfHGY6464xmuus0V/491IaJ6X4Av8CBmTmKKVJQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cwsvm1r+i0lhh6USUaMuexfKnjE4HeOG1TYdrrcvFeAP2EUkNGGKWw1BYNoW1YI6g i2uUM183/O4cJhmnFUVOwtpnMxQ+akApq3Q9j6PF/rnlNbxU9eV8ayPu468nQs/K0a tXpjUlo9Gojb2J5yb042qviQP2hmYz1uK8+ytcD0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 181/299] media: platform: sti: Fix runtime PM imbalance in regs_show Date: Mon, 10 May 2021 12:19:38 +0200 Message-Id: <20210510102010.939023895@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 69306a947b3ae21e0d1cbfc9508f00fec86c7297 ] pm_runtime_get_sync() will increase the runtime 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/sti/bdisp/bdisp-debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sti/bdisp/bdisp-debug.c b/drivers/media/platform/sti/bdisp/bdisp-debug.c index 2b270093009c..a27f638df11c 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-debug.c +++ b/drivers/media/platform/sti/bdisp/bdisp-debug.c @@ -480,7 +480,7 @@ static int regs_show(struct seq_file *s, void *data) int ret; unsigned int i; - ret = pm_runtime_get_sync(bdisp->dev); + ret = pm_runtime_resume_and_get(bdisp->dev); if (ret < 0) { seq_puts(s, "Cannot wake up IP\n"); return 0; -- 2.30.2