Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp714229pxv; Thu, 15 Jul 2021 14:13:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJjeqDQ41igb3ryfDZKxOfC10mj7mDDFN21uBLp4lRRjEIkxIx0iXJe6KBS85MZqgA+/nc X-Received: by 2002:a17:906:3693:: with SMTP id a19mr7867216ejc.237.1626383624213; Thu, 15 Jul 2021 14:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383624; cv=none; d=google.com; s=arc-20160816; b=1GjwI75PtWWHimu7gE33d2zUZlIPYpO9Un//rb41xJNOig3xrdK6nS+fpHJS4CY1X5 lEmCxsHYlU+XeHBjdrp4MzOCuSabi+zAQk5g+MDJ6tOj64DFHZJUbRg1tM7z8JwI9GS3 x8CN5+SmAonAvNdPwFyrI6FkXsXbrXmTTFjRdxXI3kTP5c5/gi25rLK1pzVdcv8Ji7KA sjdUeDs4+XB/xDuNfUrLRm78Y1M1qdqmi7gP/TGw1tdDU5kYukI0q+HQKVI5AT9E8VGs 2ZxWErG2yO9qWAqJ/vRT+0S+8sHhC81L2uxMezGxGZYumYvtlb6YFfPX1rVw0Q8tGIMY m5Yw== 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=5Nd455jquvCpq3AgFRdygHrqWDUc/3Gxc3rZ2TEQQ9k=; b=KXMm4CmbouomIIhH5q3IGT+g06HO2PND4hiVnHjWRis3NE5ms4z0n0/SBNAtb3+DS2 8xAmQGC6L4TzijiNht+McSnBPcP82hP/Tg5CP9Bz7iwmul6F0gO7NgU9KRm5xhuRDS7v fLqME+DijRn6R9amPSlLkn/VCIybSNn4orcnqSQMFW01sdao+/0Loprvpqdl7vcs651I DB+PJYB+j5cV43jC860gjE456mYYIBVBtATx2yu9jxv556PncKgVXWmcm4M5nm3YX3xT WnxGdptavdJX0hMttY9hHfsIkF1jByKwBqfqLYV/nDuGU3wlSCje80AhncSXazqp7whz RmfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2F1kg5P8; 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 7si9160685ejh.116.2021.07.15.14.13.21; Thu, 15 Jul 2021 14:13:44 -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=2F1kg5P8; 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 S1344892AbhGOTae (ORCPT + 99 others); Thu, 15 Jul 2021 15:30:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:45860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242086AbhGOTId (ORCPT ); Thu, 15 Jul 2021 15:08:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E16B2613F1; Thu, 15 Jul 2021 19:04:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375855; bh=ATMVMNovce+DZWv4rOeX61fMwsj/XRM8LRWc5mjksmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2F1kg5P8oEfQyvqoU67myY0KxfNJFYddjoYQgdXxHeDBwzfC61fpl0w7FCGCmUTr5 JbGmV/Mjz69Pbz1WGRkKxwVW4oed4cqS/nhCfMWqiO6m70cWDDa5nro8iVNZ90EedR 1wX69pRtt/gU9Z81lVkWwPicOtxyZw7zyw+v/aGQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wang Li , Chun-Kuang Hu , Sasha Levin Subject: [PATCH 5.13 022/266] drm/mediatek: Fix PM reference leak in mtk_crtc_ddp_hw_init() Date: Thu, 15 Jul 2021 20:36:17 +0200 Message-Id: <20210715182617.875771380@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: Wang Li [ Upstream commit 69777e6ca396f0a7e1baff40fcad4a9d3d445b7a ] 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: Wang Li Signed-off-by: Chun-Kuang Hu Signed-off-by: Sasha Levin --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index 40df2c823187..474efb844249 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -260,7 +260,7 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc) drm_connector_list_iter_end(&conn_iter); } - ret = pm_runtime_get_sync(crtc->dev->dev); + ret = pm_runtime_resume_and_get(crtc->dev->dev); if (ret < 0) { DRM_ERROR("Failed to enable power domain: %d\n", ret); return ret; -- 2.30.2