Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp713594pxv; Thu, 15 Jul 2021 14:12:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJEDqh+yn3ciQT4GsgepiN4ofw4fnK1V2b7pTvBpc0jTLWHKbaGTbeKJ2Au8EkAuH3IcmW X-Received: by 2002:a17:906:2590:: with SMTP id m16mr7632945ejb.265.1626383567980; Thu, 15 Jul 2021 14:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383567; cv=none; d=google.com; s=arc-20160816; b=gI3MD0VfW9JUkw3vUJ5wqFRwkUnmeeQ5syi/mmgNmAP9ejFkrQyXDuzGDZV5uOo+gt s/k2FoYtwaulPzEfJkGSouZg8TlLbhnVSZ5/fBcYEC3OV8AGPWReNxCYqeN9ECyfjyxp 5RNTYvfL1LIGdoaomUsuzxSmfYdSTuvrq5DlmSIOZ7LKBeDcFo6+BSw6gluGoIGbsyoR OdL4g4i54nNLnnbtzo+uJk9i8M96yw9Tyx+k5mz+c8diIJVmuf4ptTRRS/DY6lONq11K FAbqmn3t7L9KSJV8fZf+koZpXcYsDFSPxPoonAEx+vFfpXxVe/jpqs/Bjr6LKglCeGqW dwkg== 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=W/u8cDsFcps4AINouSbUEQsuiowuzKREz4taCiA8MzA=; b=QUVwRS4UH8YGh5eS/ZRhW5AS2MpeQMTG0mudSXuykru+yghd1BR+smcrptlcL5sv6u rz0XuStbY1Rr8VLEdcihXpU6Zy+jq4yUcSWawvKacvahMkj6t94g6Py4o+pYvN9HKOJJ hclXQ4ks1pJ7ZbCrpf+4vNKU2augfImKBcnkkE1OAU+L+rdsyqtVI0ppE3fiBmeavTo8 Xy2FAn6XfuSb6onwmZYhxpX+kyy5PSI4EOipcACFlcwGYOVdhzhw+bqHy9V9RZSTvYMr Gp7v3Ht80fXZTzkwZWiZ5rciQfc50wbHbkf2hNdO8sh6XonFA+a25gF5FmID1bocm3zk XDHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mdMhFRIt; 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 kj17si8751402ejc.159.2021.07.15.14.12.24; Thu, 15 Jul 2021 14:12:47 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mdMhFRIt; 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 S244437AbhGOTZy (ORCPT + 99 others); Thu, 15 Jul 2021 15:25:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:46538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242874AbhGOTJU (ORCPT ); Thu, 15 Jul 2021 15:09:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 03504613F7; Thu, 15 Jul 2021 19:04:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375890; bh=MbgXbctIS4MN5Fco/wMzsI2RvzamO0gMcpHWVPZjc5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mdMhFRItCuDJ2GywIWf/hUphGMBQ8ZCZQKtJzDIyaAyhLSmB6FDM32CBS7/weyv5G TpcisCukmFhO4PKoyf3KLarrZ6x4MfkAXOJrTv4xum05P/SmCKeMAkqC1TWgIOgG3p GefNmOr74CgMvJa3xPdqPQFsNcKg7d9cGmnJl5sg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zou Wei , Maxime Ripard , Sasha Levin Subject: [PATCH 5.13 038/266] drm/vc4: hdmi: Fix PM reference leak in vc4_hdmi_encoder_pre_crtc_co() Date: Thu, 15 Jul 2021 20:36:33 +0200 Message-Id: <20210715182621.019296620@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@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: Zou Wei [ Upstream commit 5e4322a8b266bc9f5ee7ea4895f661c01dbd7cb3 ] 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 Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/1621840854-105978-1-git-send-email-zou_wei@huawei.com Signed-off-by: Sasha Levin --- 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 e94730beb15b..23e7cfd987bb 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -745,7 +745,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.30.2