From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Varadarajan Narayanan <quic_varada@quicinc.com>
Cc: lpieralisi@kernel.org, kw@linux.com, robh@kernel.org,
bhelgaas@google.com, quic_krichai@quicinc.com,
linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] pci: qcom: Fix 'opp' variable usage
Date: Tue, 9 Jul 2024 12:39:15 +0530 [thread overview]
Message-ID: <20240709070915.GA7865@thinkpad> (raw)
In-Reply-To: <20240709063620.4125951-1-quic_varada@quicinc.com>
On Tue, Jul 09, 2024 at 12:06:20PM +0530, Varadarajan Narayanan wrote:
> qcom_pcie_icc_opp_update() calls 'dev_pm_opp_put(opp)' regardless
> of the success of dev_pm_opp_find_freq_exact().
>
> If dev_pm_opp_find_freq_exact() had failed and 'opp' had some
> error value, the subsequent dev_pm_opp_put(opp) results in a
> crash. Hence call dev_pm_opp_put(opp) only if 'opp' has a valid
> value.
>
> Fixes: 78b5f6f8855e ("PCI: qcom: Add OPP support to scale performance")
> Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Fix was already submitted: https://lore.kernel.org/linux-pci/20240708180539.1447307-3-dan.carpenter@linaro.org/
- Mani
> ---
> drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 26405fcfa499..2a80d4499c25 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -1443,8 +1443,8 @@ static void qcom_pcie_icc_opp_update(struct qcom_pcie *pcie)
> if (ret)
> dev_err(pci->dev, "Failed to set OPP for freq (%lu): %d\n",
> freq_kbps * width, ret);
> + dev_pm_opp_put(opp);
> }
> - dev_pm_opp_put(opp);
> }
> }
>
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
prev parent reply other threads:[~2024-07-09 7:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 6:36 [PATCH v1] pci: qcom: Fix 'opp' variable usage Varadarajan Narayanan
2024-07-09 7:09 ` Manivannan Sadhasivam [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240709070915.GA7865@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=bhelgaas@google.com \
--cc=kw@linux.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=quic_krichai@quicinc.com \
--cc=quic_varada@quicinc.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.