Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E91B7C4361B for ; Tue, 15 Dec 2020 18:51:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6BC9722AAE for ; Tue, 15 Dec 2020 18:51:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BC9722AAE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DB62C89B55; Tue, 15 Dec 2020 18:51:37 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 138C189B7B for ; Tue, 15 Dec 2020 18:51:36 +0000 (UTC) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D605D593; Tue, 15 Dec 2020 19:51:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1608058294; bh=CX19z2xhCWPnBJt/UfsNscnL+UtMH1/Faxi7jyzarwg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gv0NOM/zNituv2OO8aeHLIFlpSHjwSOuyFonMWxqgNryPKEh7ifrZ9vuIJi0qs04H WO+lJvGsW9krNboPZkiZpnntdYJMpnwvz61OgOoPVCFJ6w564kDpt1DzlJLoZjR57A NZyOQG+OmyGuDMnXb8KmGRGitauOKFm/xWv88l2M= Date: Tue, 15 Dec 2020 20:51:27 +0200 From: Laurent Pinchart To: Qinglang Miao Subject: Re: [PATCH] drm: rcar-du: fix reference leak in rcar_cmm_enable Message-ID: References: <20201127094444.121186-1-miaoqinglang@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201127094444.121186-1-miaoqinglang@huawei.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, Kieran Bingham Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Qinglang, Thank you for the patch. 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") > > Fixes: e08e934d6c28 ("drm: rcar-du: Add support for CMM") > Reported-by: Hulk Robot > Signed-off-by: Qinglang Miao Reviewed-by: Laurent Pinchart And queued for v5.11. > --- > 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; > -- Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel