From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: "Krishna chaitanya chundru" <quic_krichai@quicinc.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] PCI: qcom: Prevent potential error pointer dereference
Date: Tue, 9 Jul 2024 10:44:55 +0530 [thread overview]
Message-ID: <20240709051455.GH3820@thinkpad> (raw)
In-Reply-To: <20240708180539.1447307-3-dan.carpenter@linaro.org>
On Mon, Jul 08, 2024 at 01:05:37PM -0500, Dan Carpenter wrote:
> Only call dev_pm_opp_put() if dev_pm_opp_find_freq_exact() succeeds.
> Otherwise it leads to an error pointer dereference.
>
> Fixes: 78b5f6f8855e ("PCI: qcom: Add OPP support to scale performance")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@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 1d36311f9adb..e06c4ad3a72a 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.43.0
>
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2024-07-09 5:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240708180539.1447307-1-dan.carpenter@linaro.org>
2024-07-08 18:05 ` [PATCH 1/3] PCI: qcom: Fix missing error code in qcom_pcie_probe() Dan Carpenter
2024-07-09 5:11 ` Manivannan Sadhasivam
2024-07-08 18:05 ` [PATCH 2/3] PCI: qcom: Prevent potential error pointer dereference Dan Carpenter
2024-07-09 13:59 ` Anders Roxell
2024-07-09 5:14 ` Manivannan Sadhasivam [this message]
2024-07-10 5:43 ` Krzysztof Wilczyński
2024-07-08 18:05 ` [PATCH 3/3] PCI: qcom: Potential uninitialized variable in qcom_pcie_suspend_noirq() Dan Carpenter
2024-07-09 5:15 ` Manivannan Sadhasivam
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=20240709051455.GH3820@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=bhelgaas@google.com \
--cc=dan.carpenter@linaro.org \
--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=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.