Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp652420pxv; Thu, 15 Jul 2021 12:31:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp9GYbWEt/7SDoxfbTsInbIw6p0rS7hSMIGh1vRia6yTxqlivfX/Iwx/Zd/UGFDe1XWaSb X-Received: by 2002:a17:906:9742:: with SMTP id o2mr7273582ejy.532.1626377517458; Thu, 15 Jul 2021 12:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626377517; cv=none; d=google.com; s=arc-20160816; b=kH88FhpNq6uZHgg8Al8YhRLmyaGvnhQl88jSoCexhA6FtyoA4iKz55V25iC3j+rF5s LQikQzl02xh0eB7JWlth2g8eIG885PgBS7HwDp8QX2WkybAW0QcowXqBePXdm9oACDhZ +Tssy1Ydc93/suFwayQrKEeK1kEkHBuFZZyGu4n8tod9QElNXalGqFRADKnk4McCgczF KMyaa0RvO5qQcw3evd/xTEGNhJBvdiGGXVdwBhz3i3YydBtZ3aP4Ovr3SoQsNeXrwkr3 YYRZfXsldVPw/hKgCPuhs+lRV7z0BhDXDXJta36eTCuGVEZ30Y3GF/brYL/72RKEgXgy Zwkg== 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=qHmgSk4E/IRy0RwAB3ablAlu5PyJ7wyDvN2NFPwaoZ0=; b=Q9LUstdm9gwTBo3Zn1vqMCdmzTEjxJ1OcrriojtXGGDCHVKKCzvPVynlwJ1IA24lug K5MwOsYSfLnDQx9ed0zMBPQuIE/zNVO4EIiPmQF1jFAsllMX05bK8mPize8qFf0EfnLa fteyhtahks6TiNUOF0Ku+Vb9MUbNu4NP1+IqvScXllbOIqecKSxEdt5fiOC3GZCz2ZO5 JU86WnL/PY5hH32Hx74qee/AFoEH1MqJ+xpC3CFd4PEeqeB0/N/wMyYsX9VvYHnPjZEj IGq1HjtGWCVMh4bTp/FNIB40icSKaGlLpV8AV90C8OjF8jhSzT01xMUmFHVXnz21z1Ku 96+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jzGV9nqj; 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 js22si1584583ejc.729.2021.07.15.12.31.34; Thu, 15 Jul 2021 12:31:57 -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=jzGV9nqj; 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 S242086AbhGOTbC (ORCPT + 99 others); Thu, 15 Jul 2021 15:31:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:46434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243333AbhGOTJp (ORCPT ); Thu, 15 Jul 2021 15:09:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 26BC961416; Thu, 15 Jul 2021 19:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375935; bh=3TknRs7jyrXAfj5flQ03eMn8DEVq11RAc6wlWlgdPjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jzGV9nqjO61aaAZMi46Kn9JkfPehC7POWsger7VoIRGxGzawI5hr6aDf2MPsAXf4x 9izIr8GIe2I5dmJoIlAZ6fTKpJVBul77WLd3To6qIOaPkxI+SX5zrW+36CkVLh617+ gol8PUMeZ0+wDFW9fnxUxQojKBoYOi1bV73tdPtY= 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.13 055/266] drm: bridge: cdns-mhdp8546: Fix PM reference leak in Date: Thu, 15 Jul 2021 20:36:50 +0200 Message-Id: <20210715182623.922572870@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: 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 989a05bc8197..ddcd5b6ad37a 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