Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9110452pxu; Mon, 28 Dec 2020 06:55:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2qOKjwQ1dCFYUApEJ5YNSk0+FU+hfaFu8kbf3Mc/Rs1tZbsf9voihIy2GpnSkRsxpeSGX X-Received: by 2002:a17:906:5796:: with SMTP id k22mr41237226ejq.435.1609167312006; Mon, 28 Dec 2020 06:55:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167311; cv=none; d=google.com; s=arc-20160816; b=DBt8I1hOQK3CA4t9TjiNFcdjkph3Z1jEEwaD1Ty6Eo+nrsyxrYdxcs2+gVjsNyFj3F uiyXpGsbiH5I3fZfH41Zuc0UHg9EG9U/2heWdGPIduk2lfAY2N568zlqF4TaIK7IGFKy 4AEJl/Y1T9HxSvkvIDCSNH1NUyC8rQquWENGkPKxF+/UPd4/8L+woUnquIpIBJz2VPyB 5qTJHVofz7FIG5poJm+v4xKTRfQgODPJEKFU5YAsWB14G0MDpiWbmxK8hDSBLQzndxeR IpJSqJVvBB+MzIok6WnYtf6vd9GyoqWSW+S3S4QGzYgp0pvSNQCN8/SN7sqorkJdrRqF DcgA== 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=+c6WW3e500ZpiCSAJHkBHn0JHc4+XoXhKiZm1z5f+Bk=; b=VgrTu0g15bvVeIJiSZisa4DS3gUTbcJ+W22wBujmx8Dvsp6LfQ+JDXYXl+BIcThXwK JojWJGxVNZBt8DHNc8spWmeFU+fEYenC0Kcc/yBSFOw1nrSKMv9HlSrWxWzj0rb0UPj9 yErG/P7QBcDPox6+1XS142Aou/pfoApSEBx6opawikC8bszcXOo/0gAIeN/YRhrFbjqt nIfa4v460dtfiuMYFs86XiavNiLD4yKqxdHGMVkUBqnX/73mEDdcEtaClvgTgVEjdS+/ bpVFIt/XrRZarYUOtrN86U2JzPzvwDW62Ag8fzRf41z2xoiQSdJiQ6wr0u9WizbOba4x JLzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kgnano+A; 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 o16si19899355ejx.217.2020.12.28.06.54.49; Mon, 28 Dec 2020 06:55:11 -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=kgnano+A; 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 S1727472AbgL1Owh (ORCPT + 99 others); Mon, 28 Dec 2020 09:52:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:53782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391848AbgL1OSf (ORCPT ); Mon, 28 Dec 2020 09:18:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A77B1229C5; Mon, 28 Dec 2020 14:17:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165075; bh=QFcOCf6/dqVbQdjswjoTMGQEZimxv/lEJji/qplAcpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kgnano+A9zxigYuFoOpJWviiL8sR9zFhelxDUHPA+lBQRMeWH1+Su381Of21muk2x 4j/blyvSsQ3dYpL4RSP+mpr7daSD9wOjdhJR7vs23l3heFAC5ZjRfevYbsO0AhNloV yY9B7gFtgq5rd/hH63qbcMqswKCRbCBUi5zMRXXg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.10 401/717] remoteproc: qcom: fix reference leak in adsp_start Date: Mon, 28 Dec 2020 13:46:39 +0100 Message-Id: <20201228125040.202981948@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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 aa37448f597c09844942da87d042fc6793f989c2 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to pm_runtime_put_noidle will result in reference leak in adsp_start, so we should fix it. Fixes: dc160e4491222 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20201102143534.144484-1-zhangqilong3@huawei.com Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/remoteproc/qcom_q6v5_adsp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c index efb2c1aa80a3c..f0b7363b5b268 100644 --- a/drivers/remoteproc/qcom_q6v5_adsp.c +++ b/drivers/remoteproc/qcom_q6v5_adsp.c @@ -193,8 +193,10 @@ static int adsp_start(struct rproc *rproc) dev_pm_genpd_set_performance_state(adsp->dev, INT_MAX); ret = pm_runtime_get_sync(adsp->dev); - if (ret) + if (ret) { + pm_runtime_put_noidle(adsp->dev); goto disable_xo_clk; + } ret = clk_bulk_prepare_enable(adsp->num_clks, adsp->clks); if (ret) { -- 2.27.0