Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3297767pxu; Tue, 15 Dec 2020 03:44:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJydHFRtAGfG/7hsXjb1pVvwH2oojPAy9NO5OSQor2QwacoW+NQm2YQ0jZisRjcxS7ywtY1Q X-Received: by 2002:a17:906:ca08:: with SMTP id jt8mr12893751ejb.368.1608032659243; Tue, 15 Dec 2020 03:44:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608032659; cv=none; d=google.com; s=arc-20160816; b=tM2d26uTzeT4WuSaQDEFUad5OGbWCSuLNnAoCJbuVtHjW4j6XEKyIiFFbqD0RKlhTW pdljEv0HpD8T/272x3mToZFcoq9UG0nlw5OSbAQr9p9jO1zrHlpFjj2YRpzLeMlAgov/ SdVKQrOr1hZfx2eWyI2BOTeLkdqlFNqFX5Je4DwzFbxQjR4Iut4VgSj/UX+NlqkSNJak 1AWKQSl2MYxTVZReZt78iJCP47B3hVkfYnrKgUxJ9aEdAlljHLu3GM6v/13dqZILSAXW krTSqqthudpSLRjB8T11JFeBEjgWzk+PGp7dGS5V3cBO/EA6gdQzQi+JdyseqR0X8kx+ 8ZrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=SCghu9s2/9ku5/O1I+etgT8/0udvi3eEb1NJB4rWjKI=; b=edBmS2v7p1WkoMaY8B1ICpr2iBAUAjzJgZZ3yhLsE2IZau2G2KZKpquhkIUQ/KWvLv 5TUrTQtqilW+A3ejBmPwMQW9tha7Wvr1ARYfPgpWrzOEr4lqnx2xS6CG9mKenBDE39NC qi9/u+hRjwtP3+xSdmW7qgedleSEAb16g+/gj/+BT+VqZFGJP7ehN3kRFi3DBtQlY4y8 WW+OgwNqOK6hpD36zsa/yBOhrk0j44KPYuBzQ0SQrXKms4AdhXtTn5JkmYUFTIFqqXnO FbuT3fJIlTnOVtR29M/sLFgGkTacJd47TvWn7dFLTXkMQIh0UZaI0uLu+nlwoMdGCdIs IbYg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a18si657968ejf.618.2020.12.15.03.43.53; Tue, 15 Dec 2020 03:44:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728701AbgLOLjt (ORCPT + 99 others); Tue, 15 Dec 2020 06:39:49 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:39095 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726951AbgLOLjZ (ORCPT ); Tue, 15 Dec 2020 06:39:25 -0500 Received: from uno.localdomain (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 2020D200005; Tue, 15 Dec 2020 11:38:34 +0000 (UTC) Date: Tue, 15 Dec 2020 12:38:45 +0100 From: Jacopo Mondi To: Qinglang Miao Cc: Laurent Pinchart , Kieran Bingham , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm: rcar-du: fix reference leak in rcar_cmm_enable Message-ID: <20201215113845.zy4keqwnk3kgw2z2@uno.localdomain> References: <20201127094444.121186-1-miaoqinglang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201127094444.121186-1-miaoqinglang@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Qinglang, On Fri, Nov 27, 2020 at 05:44:44PM +0800, Qinglang Miao wrote: > 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") I -think- you can break this line. Anyway, maintainers can fix when applying if they feel to. > > Fixes: e08e934d6c28 ("drm: rcar-du: Add support for CMM") > Reported-by: Hulk Robot > Signed-off-by: Qinglang Miao Seems fair! Acked-by: Jacopo Mondi Thanks j > --- > 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 c578095b0..382d53f8a 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.23.0 >