Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2484322pxj; Mon, 10 May 2021 04:12:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZKHiajK2FFgV78iuM06zYzklMMAiekY2gOoy3UDwFH4CaaZ+ionoCr/PG2JJNFxSqDP+J X-Received: by 2002:a6b:b48d:: with SMTP id d135mr17801843iof.107.1620645157637; Mon, 10 May 2021 04:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645157; cv=none; d=google.com; s=arc-20160816; b=XbtCUpOkrd0Y72ngFzbY69sVONmo6MD0jaKrftwikbjQc4U7Tx7+4DhHZztRmk/nn8 BCKhbTP9PaP7kE3le3iJ7bqQL/KKpub7q/UlPgXOUY/gF0jdwNz2fVlkPyThAy43KuJf 96K8Wi7EWi+KG7YVMmPbrvi5N2HpYWQR265vAMuPleMeqaaJTRJMX+Wc3JIUeVirfQaY pvbDt/A4XlLNDAw9G61mXLxfihXDhhRnIj2I6rH7ykwg5f+5HMSW2zzjRwX8jTcMpQhE jVdJLA1fAU06pQ/lDTy9GRhTNaVt7fXOWmMZPXx/IT463LBPRmPcSm4DT39ry86QoL2X SGkw== 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=VAN9Bsnq00qf7ZU3pK57fnldVlUhFBuas1MLUp26q7Y=; b=Koxerh49JUIM2pJp1uCIOXutAau1CARgdHUWgzqJA9VZcqebM6CalftW3dR7EnMchN 9c4hwsBdTguHsk/+1Hn/BFJVTj9MBiBuX0wkd8x/O4xMjVKGRk1RqjcowTBqylps3Y0+ dIjfIRrpdvbghfm0HjESDZYUYY59cb6wOqu2BIifazxGqlCCua3p21Auvmw8KIYgjERW 4x8hwClletuvpNcpQKBW5c2+MDjO71KHGj2cgcG+Ne+uos96fQIYzLexyy4+BmkQ6TmZ EoIQShJiUGnngZQgnZS8UiB3gMqZfEK4W+3YapcF1AK/bp37tg+s+MK2w3zPLyJVPaK7 aemQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l1z72IgS; 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 x7si18888282jat.98.2021.05.10.04.12.25; Mon, 10 May 2021 04:12:37 -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=l1z72IgS; 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 S237299AbhEJLLs (ORCPT + 99 others); Mon, 10 May 2021 07:11:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:41704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233203AbhEJKtv (ORCPT ); Mon, 10 May 2021 06:49:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6C250619D2; Mon, 10 May 2021 10:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643110; bh=pnU9lood80HhbEnlhYAl1vyRpRzo4Er1YBUOOWUprhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l1z72IgSvsdNvnlgIBJYW4+3TXVyJMUT0ykEA/gsB5ORR+ooFXaZoGUIauOLtj7hV bQpT/6wEATJhfpPMEVFAIYHWyGe6FnKjDuQMG2tE7dB84D+KvDM/7qlXD1ST7H575f yXwy27Cqxi9nsrLluEXbomJCKYxP+P5EWpoyeP8s= 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 182/299] media: sun8i-di: Fix runtime PM imbalance in deinterlace_start_streaming Date: Mon, 10 May 2021 12:19:39 +0200 Message-Id: <20210510102010.969519680@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 f1995d5e43cf897f63b4d7a7f84a252d891ae820 ] 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/sunxi/sun8i-di/sun8i-di.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c index ba5d07886607..2c159483c56b 100644 --- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c +++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c @@ -589,7 +589,7 @@ static int deinterlace_start_streaming(struct vb2_queue *vq, unsigned int count) int ret; if (V4L2_TYPE_IS_OUTPUT(vq->type)) { - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) { dev_err(dev, "Failed to enable module\n"); -- 2.30.2