Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3177606pxj; Mon, 24 May 2021 00:03:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGri11nwHZnrWFJTxnUfj/csEsXLVfujBcSGYBaAEyCTW+2m6xkQCkW1ulvWje5RrC7b5l X-Received: by 2002:a50:f38d:: with SMTP id g13mr9627745edm.178.1621839810211; Mon, 24 May 2021 00:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621839810; cv=none; d=google.com; s=arc-20160816; b=WA/J9D7QGEk4Q424v26/V8Of3GqmCX19phPCT0aI3auuwNeVSnml92w2if6rPy5bF7 T9aQT4PAoAixZvvbu4F5BYYIwoq25PNyn1OG7+q2y2W0YLLGXci33n9xU96kKtsz3yKE wGHBE76xq/Acd6VrvBWxSihU/fhjDAhiCsRS73t7d6gxwMMok7AuO6O3x2qt0nMpvTno GUqnSi8OOEx9OF7HG8PPmCZqYV1uGQVVhAVW5A0hru+6U/yEoC/MwGSaPHHiYU0qNDfB T9BV09rDy6IGz/lIt/vPCAOTnbCQrBcZeoyy7Q2zDUSGyveRUFgSDoNIobdYDUW3Xhp/ x9+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=8Ka/IxLuS3wQ0LP7V6yQRYVhMzhz6nD2PM6EuRxomVY=; b=rxgpjKwMhQ0m2iAHa4FfqWBEGaJA+q5Z8Ifyf9t1Ao3KX65cieoNtaLbtq9TKoTYCc txysBpS1nLdSNTt0nVGAWHhhJAJ7FFlmmZwMW9xZMCpjvteUlds6C/PvaKvxoT6wyAs+ ySrvYSDI+FS6qI4MLWECwlcKZu0vq90gl3oUXk5xjgnvX221VZDIHcKhz1yWSscpPSeM eMTmiacKLaJZyyMI6NTn0QY5VgvK1q6BvaKVjfy7QOnAXBGsOguHkxSAZR/6ert+yrVb UAwpRwfaZaOrTHJ9xcY8ZmX3t0aPMjJOcZp7YUVZ1MwseQKPttIX6YjM/wNhIvXAEJ2q PfRg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si12412656edc.221.2021.05.24.00.03.07; Mon, 24 May 2021 00:03:30 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232332AbhEXHDj (ORCPT + 99 others); Mon, 24 May 2021 03:03:39 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3639 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232120AbhEXHDi (ORCPT ); Mon, 24 May 2021 03:03:38 -0400 Received: from dggems704-chm.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FpSjQ4skMzQrPb; Mon, 24 May 2021 14:58:34 +0800 (CST) Received: from dggemi762-chm.china.huawei.com (10.1.198.148) by dggems704-chm.china.huawei.com (10.3.19.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 24 May 2021 15:02:09 +0800 Received: from linux-lmwb.huawei.com (10.175.103.112) by dggemi762-chm.china.huawei.com (10.1.198.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 24 May 2021 15:02:08 +0800 From: Zou Wei To: , , , CC: , , Zou Wei Subject: [PATCH -next] drm/vc4: hdmi: Fix PM reference leak in vc4_hdmi_encoder_pre_crtc_co() Date: Mon, 24 May 2021 15:20:54 +0800 Message-ID: <1621840854-105978-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggemi762-chm.china.huawei.com (10.1.198.148) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index c27b287..f20a65b 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -798,7 +798,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, unsigned long pixel_rate, hsm_rate; int ret; - ret = pm_runtime_get_sync(&vc4_hdmi->pdev->dev); + ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev); if (ret < 0) { DRM_ERROR("Failed to retain power domain: %d\n", ret); return; -- 2.6.2