Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp713684pxv; Thu, 15 Jul 2021 14:12:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/pEvA/RSyl7aPyGbbVsOJRv4nqQm1dVDr5EDfHtRlcI/iIWPI+z5g3isHJAeVysBmV47d X-Received: by 2002:a17:907:1b02:: with SMTP id mp2mr7667111ejc.196.1626383576254; Thu, 15 Jul 2021 14:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383576; cv=none; d=google.com; s=arc-20160816; b=qX2WDjxDNmn4A9WrF4pWDzJzU1FTCf7rgtOUWVb1k1SYC4y1EK17uuNAEBdbxVNWP7 lk4lE61MxgYe2AsoSj7Uwz+3Z2KNRZqoOUIT8jnsaTtj4c8/wG6A6y02Sz0ZuliXQPiE ivLZqtaRPtpS4JVriFv1NriCgGxpSJZxP+ZXXfwIJgnMVvHcNFzrFmTBrKF8fIUyh9zP xm4QbkInuy1WrOIlParggzZkARnkYHzEyhLAHBoF8wmxrsg1NpGlbOS5wetBo454/ERq hwSyEfqbyWnSUqGs28r22+afJvwfepfZ9+IzhcpZG8ikrkAgrMYpf8w2SB4ZfQ93p7gK 1Q/A== 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=7EjWe3WUyhWQIJjHPiAIGYeBfWuBDqzjS00iHBJKG08=; b=VsZvAk/+dZcpM2Wf741pY0dxeZZUhCyQ+2EQvf81s8lBdkZwqNCizsqWY2Wcp+yVgy asaXceI6GbXJKVUElcXtmpMjuXFBOgIM+aF9q4vp8s445kgUJH8Nwn8exZGxSUrgb2A+ EESqaxEettulf5+ffQ0EkDMj8X4shYuOPRsed/cTcGKyuyRyS9/X1rFrVnAQvMWfl4Sy v13fI746IAD5Cxyq5rDLaXk0EuSKlE1l7iAerVfwfV6jBEIgyyGLbFMSM1bOWqU+eF3I yiBkOGs0Zbw+uxMeVeRBmMsS8RxKd1kPDSnoMu0Mr2qcNhbvUiM8Cc93mEgIg2bkZfnD A2VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2dgU7huV; 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 bs19si8330542ejb.398.2021.07.15.14.12.33; Thu, 15 Jul 2021 14:12:56 -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=2dgU7huV; 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 S1344434AbhGOTZh (ORCPT + 99 others); Thu, 15 Jul 2021 15:25:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:45648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243153AbhGOTJ2 (ORCPT ); Thu, 15 Jul 2021 15:09:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5A046613D3; Thu, 15 Jul 2021 19:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375899; bh=dU+sE3O5fFtWgS0WL4SVp5dHsvS6LMM2bVi73Rk4nhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2dgU7huVg6kZOfKAuemjeyDrxE5HttJ4mJqA8vnBeDV6NIy4OQIRCrWUvF0J1TOnQ CO+6YJQjiE4OjAGee1wiMyPEx2Wdf7eHWKsfvFPHot4m201BwTC/IYxHav2G7AdFow EfjlxeHV0uneevJmv3jaiGuh560d7NSkjfenm+/0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zou Wei , Robert Foss , Sasha Levin Subject: [PATCH 5.13 042/266] drm/bridge: cdns: Fix PM reference leak in cdns_dsi_transfer() Date: Thu, 15 Jul 2021 20:36:37 +0200 Message-Id: <20210715182621.710814455@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 33f90f27e1c5ccd648d3e78a1c28be9ee8791cf1 ] 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 Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/1621840862-106024-1-git-send-email-zou_wei@huawei.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/cdns-dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/cdns-dsi.c b/drivers/gpu/drm/bridge/cdns-dsi.c index 76373e31df92..b31281f76117 100644 --- a/drivers/gpu/drm/bridge/cdns-dsi.c +++ b/drivers/gpu/drm/bridge/cdns-dsi.c @@ -1028,7 +1028,7 @@ static ssize_t cdns_dsi_transfer(struct mipi_dsi_host *host, struct mipi_dsi_packet packet; int ret, i, tx_len, rx_len; - ret = pm_runtime_get_sync(host->dev); + ret = pm_runtime_resume_and_get(host->dev); if (ret < 0) return ret; -- 2.30.2