Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9043552pxu; Mon, 28 Dec 2020 05:15:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKEUtxywmbQL8odd3DfBNhP1JUYa6/C0EeiS6zuSqEmN+2jf7dw8E1q7VjD85xTBgTc6G6 X-Received: by 2002:a05:6402:1692:: with SMTP id a18mr41102968edv.321.1609161319249; Mon, 28 Dec 2020 05:15:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161319; cv=none; d=google.com; s=arc-20160816; b=ZUN+n7UNBsSO/e9UuTY4n8ljzhjudur+zHg4VDOgI590LARTfc2US473zbLGsbDHLW ITCZn3vfi/YGwNV0ChlSBEkg265+rrUDPotVGOU6gGUhgVSdxCncGgbR1s2CsMdiiNZx 2Iq4I4v09VouBN69CzSe7FA/Ko0z+PMb1q+6Y61a6XVk2zXlBHUEewe2W1fdE+25tgWt fY+3Ek+0Ro//4ZoC6AwZExeviPsguVN4aGaKyS+zWlnmhqVcFi+a5JNam8jGIwds6vTn +USu3bmgtayiXG2ECGsth+4GtVFgkMrmaBC+s0bK/v99LqilKMTFbRya8lpg2qEaPCZc dgbQ== 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=N0xKe+rBWHWuyvTgMuTaDB3n1WmXCkw1ZMfFsFGc8+Y=; b=GO/Wm7MpPVHhvrfqEy8aae5KO8pObx268NeAYO6nKGcItI+fzUIVuKpZZYsxM9dAED RaSOOIByEzpZTBTZ8nYvEmJf83vIvsOBq28n4wK4/ehPDTS9N0AGgZzeqAeSWIL+eU3E q/9pqMd2FWxjlPAVrrzzh70H8X37AAjSJFvdReRLS7jcQO7LLgE7BOB2CefOAn0Sti8R JQEaOCDbBbh2MHwGlGm5oJ+Fwl2yIMq820IO/FAAKnYMrikS9YClSfSqLxQhGKHAxgRF juJk7DAH4sqo/1QP7XN1lIpCVOeEDoBoTJOTa8vm+48Nk3z841MThMcKHfFyY1SgRg7r QBQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pFGsVkBl; 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 hr6si19933914ejc.319.2020.12.28.05.14.56; Mon, 28 Dec 2020 05:15:19 -0800 (PST) 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=pFGsVkBl; 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 S1732045AbgL1NMY (ORCPT + 99 others); Mon, 28 Dec 2020 08:12:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:39688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731950AbgL1NME (ORCPT ); Mon, 28 Dec 2020 08:12:04 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B7A7922582; Mon, 28 Dec 2020 13:11:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161109; bh=bc6GbhACSBu4w9iM3shQkXEetJ5QtseSPAXOKqeFWoQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pFGsVkBl3S1UhFcYSFbOglo28eWsjqZOzP2XfR3WT3aKe7PxOPJt35vv9pX2Vo+2K xQ/gX3AHFyA0RU/Ov8lrX2ZnflxopNxyGfVU9p2JK06jwyhjze9KzBNXu3ga9nnuBy zwMeUbJApCrRFGxsRN14IrDB9p/tyQTkFO+AVDpA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Santosh Shilimkar , Sasha Levin Subject: [PATCH 4.14 102/242] soc: ti: knav_qmss: fix reference leak in knav_queue_probe Date: Mon, 28 Dec 2020 13:48:27 +0100 Message-Id: <20201228124909.714366547@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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: Zhang Qilong [ Upstream commit ec8684847d8062496c4619bc3fcff31c19d56847 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in knav_queue_probe, so we should fix it. Fixes: 41f93af900a20 ("soc: ti: add Keystone Navigator QMSS driver") Signed-off-by: Zhang Qilong Signed-off-by: Santosh Shilimkar Signed-off-by: Sasha Levin --- drivers/soc/ti/knav_qmss_queue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index 9879ca5f8c5f5..eef79cd5a7238 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -1719,6 +1719,7 @@ static int knav_queue_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev); if (ret < 0) { + pm_runtime_put_noidle(&pdev->dev); dev_err(dev, "Failed to enable QMSS\n"); return ret; } -- 2.27.0