Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp638191pxv; Thu, 15 Jul 2021 12:09:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9kiZAEr9QaAq6TXPjp01QbwcbUbC8KbKqQVlFPyTmzrDELdDdrMc33BiC4vAd+bwSsseM X-Received: by 2002:a17:906:b794:: with SMTP id dt20mr7190643ejb.431.1626376165782; Thu, 15 Jul 2021 12:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376165; cv=none; d=google.com; s=arc-20160816; b=fhY9beuTrZdinp89JZK6S+uhkzPl2Iy9w66pswFKQlNOEsKL1xdIM/Zg1HyOIZMGkC jU8Lkp+gtVcig5zbzo9WMj3Bx5/+BdFLV9ick8P9anyiQ1li6wr4NlmnANR6AkE4JbR2 scJY4J/cVAuC8/nb6kQTt6+TO4KM9Gg8HMCjn3YgNTxHfsJCImeq706p9jUIsklXrZnZ lvs7/4q1zQ0t0ejafC+eqdcebk4dv94tv9b2jVvcOb1VtjIP+qFnWY98CA8B4aHbNuM4 ixii/Euf8JWCdh7oAyZB2vXYSg2ZNV5O34lctE7mDEj60SmFeXKQ5BhQi0U8Nk5SO5Ql 3Pww== 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=Ekry+lp7fWeDF7609qGVV37RO6+IHITZRQMG/XCCCGg=; b=E5B/o/H3AS+twDVvLCrdoC9NSBY7VoB42Wz+LFMDyWVIiQqhztLIw2B4R17c/3TqY/ SwUWZ8/U7HjbRBKQce2m94VrFuq7va9+P5Ek7TRIOZeY4BgDGkyFl77cGF4B+aDc/8Pp qoXIRqOtnKGR36zbkAMAj33VYP/EGQZ4FSP6hw6Sy9ME7G96K06vOnawoP3uB/Q8uBwr fno9nplC2tPo7sygCWd0i7l8R/Ivu2XrDNbewQ7JqAOebtSLgx5TD+cTcuAs8/EMbpar jeAeH2jvZ7f/7LPpl/ertL/c0Zl+xaH1YfOiP+c6qCf+Bwo03WMGQ1BRnQ4+x16HX0er /RtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZTMUQrkC; 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 d26si9373616edr.274.2021.07.15.12.09.02; Thu, 15 Jul 2021 12:09:25 -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=ZTMUQrkC; 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 S243482AbhGOTJw (ORCPT + 99 others); Thu, 15 Jul 2021 15:09:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:34948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240918AbhGOS6t (ORCPT ); Thu, 15 Jul 2021 14:58:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D559613ED; Thu, 15 Jul 2021 18:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375340; bh=vRhNXClf9Vk824eWZ0E1A24JGfsQynC8Y7DYt02HcVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZTMUQrkCWYcIurYGX4jolf7dt3tF/qoX0jvuPYFnShNX6j23hrj7yqisD1QGcjUw8 KYHWAQRfQl4/fSzspXQmKaH9KF83zwjmlv1uOnqpVP+Cn6ngT9QIwqiRPvfTBtq1uQ ci2sB+3BQTBuqgv2HfdeAPkD0nDeXnCw4Qb5mp3k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Yu Kuai , Robert Foss , Sasha Levin Subject: [PATCH 5.12 045/242] drm: bridge: cdns-mhdp8546: Fix PM reference leak in Date: Thu, 15 Jul 2021 20:36:47 +0200 Message-Id: <20210715182600.057406035@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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: Yu Kuai [ Upstream commit f674555ee5444c8987dfea0922f1cf6bf0c12847 ] 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: Yu Kuai Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20210531135622.3348252-1-yukuai3@huawei.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index d0c65610ebb5..f56ff97c9899 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -2369,9 +2369,9 @@ static int cdns_mhdp_probe(struct platform_device *pdev) clk_prepare_enable(clk); pm_runtime_enable(dev); - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) { - dev_err(dev, "pm_runtime_get_sync failed\n"); + dev_err(dev, "pm_runtime_resume_and_get failed\n"); pm_runtime_disable(dev); goto clk_disable; } -- 2.30.2