Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp639952pxv; Thu, 15 Jul 2021 12:11:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNbBc6g0/KHOCsYJaAz6KBNlnYJM7U2QrQIUFlp6rop4QThnwJ4XJU/272XLdFE7keT6wV X-Received: by 2002:a17:906:ee9:: with SMTP id x9mr6652227eji.44.1626376317185; Thu, 15 Jul 2021 12:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376317; cv=none; d=google.com; s=arc-20160816; b=cpTXTjtqraicAHQUsFYiUaAiU4OKobnZPiHclVUMFkE1sQO/ZA1BBpSMAR+89IJTxV SVZ8OHfuxRqb1FXvKQbIFpA4s3jQZBp6EIzWMJQprVBdLI1yMekPLCGiZBWowzTtVLEE IdWidI7eueakdxFKmLi9PDm4Mud5SpNU59Yc8zUYaVvIUWEvP83x2yj7iNMc9Bxbk+eL +VOkJOnd4Rjibz6H6YZLNde1gM/EUruOXn46lTxzOdEb19hOQ7e4auJM0W7U4axdG+mZ OGXI2z4NCZZLTL6NERtJpSjhVjyVsOdTF5vqahPyKcQoiUasFxXsEHqZlZF+IzONSMbU 5oAw== 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=cwU3b7aJCfr+Ck5um0tKXThlNJuWA4/1p55LrThhiXZOz+DiJbzKP0hWgrdAX12vWa clUfYRcoZsqEoh+FUbo1cKMb7XO7G0H52dUWZjqVdrj/q7ZWf4ZiOu4SpcByTdtfXtWh jtAdNXkOh9yLLEWKIYsNQTINNztm5stIgfCA31WjBkKif8Lkom0KmwsLVpNJmQQCLq/L GelVdFeaODG3+lyr9OTNzOsxNTS+tj+HzCmgE6ScGtgko/wi8/HZ7zNFZY8pzLICihmU CzNm0kGhPrFU1jgAfOZIhqXkW+ssYCSSszV+u2Hy9titH10mSbY36NM3wPVtunRlbK7i ITkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hSMF99Rw; 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 gb26si10631611ejc.727.2021.07.15.12.11.34; Thu, 15 Jul 2021 12:11: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=hSMF99Rw; 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 S242885AbhGOTJU (ORCPT + 99 others); Thu, 15 Jul 2021 15:09:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:34342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237210AbhGOS6F (ORCPT ); Thu, 15 Jul 2021 14:58:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5C27E613DD; Thu, 15 Jul 2021 18:55:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375310; bh=dU+sE3O5fFtWgS0WL4SVp5dHsvS6LMM2bVi73Rk4nhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hSMF99RwQv0+/IwY6sCM9YBD3AdXJWoPx1A0Z/xxVZgJkQgBH2HWMt5Qm8kPVdB9K GaiuzlJPvSR7EruL1DKVMMco9Z2rWNj9K4u4m/rEu0SfwQUP/xhC+cAFCtqKfBaB56 HJ31kHueFeXA70cb/MXGJMjxCBwrmNY7Z0A0D+Mk= 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.12 034/242] drm/bridge: cdns: Fix PM reference leak in cdns_dsi_transfer() Date: Thu, 15 Jul 2021 20:36:36 +0200 Message-Id: <20210715182557.990813488@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: 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