Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3853188pxb; Mon, 1 Mar 2021 23:34:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBucIueblQOYh3AZMPpCDxhz0NoV24/CeYAWnRdm/1JLSYQKNxwCWTNKaeNqDCIG5AK8vg X-Received: by 2002:a17:906:2bce:: with SMTP id n14mr18890116ejg.171.1614670452851; Mon, 01 Mar 2021 23:34:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614670452; cv=none; d=google.com; s=arc-20160816; b=zXwyIQIrDVMKIQCk12uz41rekSshHLh6x9bRF4PS/IowH8pAAjHYNzf6VI8BKgQm/F cYrV3yH0N+nvZbYbFNmfb4sKGbQinchGvTFiznltR7x53wfUuQsvKJxsT5HGLRVAE2Nb oI3T8DX1HL2/+YrBhYl/QRlWJqoYqNsLhzoXYusnewQWpuQxIZemIglULmurw+8tQoic Xr2v5QXlBuOiudZsWa5F2BkRSiRDfk2ptB6Bqci5j2bftTw4x8Ar3DNDfLavTfSRn1eP 0SHLTRPB74xYRXzcst9hwsWVCJDJFyZySZ2w2PKRCOahG2+7AL2wDwbXKDj32up2Xy0t ufjg== 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=Inj7dCpZvXWlM41YrZ2Z28rpmy+R0Cv7gvEr9mkIpFk=; b=joeNEVkUFHud1XiDIPJEKGXuKEMCvINXlI4mrKgYyYz4mYSmMp/a4oJTK3GnMZNNSz x9+Aw/4DtXnpGrs3tIBtpF7oskMcqWbpYZTfcFB8X8YA99jvAt2abeqPWknYI2ATNJas gOkkGT7MnMFP22H+EulLrrvy6U2GqHTX164QFMnQCRWLvev/4jdDY1K/gwa3C3C1FQ0m inRj2mzdJTFwH1clgvCekzCFIQWTIt2jVCwoboplwtvZAPfW6upA6G5WOt0Ea66J4+gI V1pCBzINw6c9TvL8eltNcuugWBj8Lo6gsIOKxw8Fvh0lbef42SgQrQSqRJrOPIR1o0xd HbjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iEhPNIbc; 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 bi15si13093211edb.551.2021.03.01.23.33.49; Mon, 01 Mar 2021 23:34:12 -0800 (PST) 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=iEhPNIbc; 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 S239927AbhCBA5m (ORCPT + 99 others); Mon, 1 Mar 2021 19:57:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:53936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240677AbhCAStB (ORCPT ); Mon, 1 Mar 2021 13:49:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3F1FE65183; Mon, 1 Mar 2021 17:10:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618611; bh=/NtNWIfCG7WbH3eGSRavY1hWp44cMgcLivxb71kLvWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iEhPNIbc8hNI6NkkWUmNr3qy+PNCR2Z5MR3Lh3AGxsWihlE2Vu+N6WBoPZnHgKtyV r7VNHnMrpCuQnCIT8sat7sbrdzSxjlPiX59UsR8fZaE1Z4OJOFij4Q1nhI1VsT/m4p ALVSOaJlqRqS7yf30uN0B+DPx23ask2M4ktClQmo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Qinglang Miao , Jacopo Mondi , Laurent Pinchart , Laurent Pinchart , Sasha Levin Subject: [PATCH 5.10 150/663] drm: rcar-du: Fix PM reference leak in rcar_cmm_enable() Date: Mon, 1 Mar 2021 17:06:38 +0100 Message-Id: <20210301161149.196797056@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@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: Qinglang Miao [ Upstream commit 136ce7684bc1ff4a088812f600c63daca50b32c2 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in a reference leak here. A new function pm_runtime_resume_and_get is introduced in [0] to keep usage counter balanced. So We fix the reference leak by replacing it with new funtion. [0] dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") Fixes: e08e934d6c28 ("drm: rcar-du: Add support for CMM") Reported-by: Hulk Robot Signed-off-by: Qinglang Miao Acked-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Signed-off-by: Sasha Levin --- drivers/gpu/drm/rcar-du/rcar_cmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_cmm.c b/drivers/gpu/drm/rcar-du/rcar_cmm.c index c578095b09a53..382d53f8a22e8 100644 --- a/drivers/gpu/drm/rcar-du/rcar_cmm.c +++ b/drivers/gpu/drm/rcar-du/rcar_cmm.c @@ -122,7 +122,7 @@ int rcar_cmm_enable(struct platform_device *pdev) { int ret; - ret = pm_runtime_get_sync(&pdev->dev); + ret = pm_runtime_resume_and_get(&pdev->dev); if (ret < 0) return ret; -- 2.27.0