From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 74DDFC388F9 for ; Wed, 11 Nov 2020 07:56:10 +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 14733206B5 for ; Wed, 11 Nov 2020 07:56:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14733206B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.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 4721889F75; Wed, 11 Nov 2020 07:55:04 +0000 (UTC) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by gabe.freedesktop.org (Postfix) with ESMTPS id 516A389A9A for ; Tue, 10 Nov 2020 12:47:30 +0000 (UTC) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CVngk0Pmjzkhmq; Tue, 10 Nov 2020 20:47:14 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Tue, 10 Nov 2020 20:47:22 +0800 From: Zhang Qilong To: , , Subject: [PATCH 3/4] drm/omap: hdmi4: fix reference leak in hdmi_runtime_get Date: Tue, 10 Nov 2020 20:51:07 +0800 Message-ID: <20201110125108.3827430-4-zhangqilong3@huawei.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201110125108.3827430-1-zhangqilong3@huawei.com> References: <20201110125108.3827430-1-zhangqilong3@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-CFilter-Loop: Reflected X-Mailman-Approved-At: Wed, 11 Nov 2020 07:54:43 +0000 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: dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in hdmi_runtime_get, so we should fix it. Fixes: ac7674567c620 ("drm: omapdrm: hdmi4: Allocate the omap_hdmi data structure dynamically") Signed-off-by: Zhang Qilong --- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c index a14fbf06cb30..33f12c351b08 100644 --- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c @@ -44,8 +44,10 @@ static int hdmi_runtime_get(struct omap_hdmi *hdmi) r = pm_runtime_get_sync(&hdmi->pdev->dev); WARN_ON(r < 0); - if (r < 0) + if (r < 0) { + pm_runtime_put_noidle(&hdmi->pdev->dev); return r; + } return 0; } -- 2.25.4 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel