diff mbox series

[3/3] PCI: qcom: Potential uninitialized variable in qcom_pcie_suspend_noirq()

Message ID 20240708180539.1447307-4-dan.carpenter@linaro.org (mailing list archive)
State Not Applicable
Headers show
Series [1/3] PCI: qcom: Fix missing error code in qcom_pcie_probe() | expand

Commit Message

Dan Carpenter July 8, 2024, 6:05 p.m. UTC
Smatch complains that "ret" could be uninitialized if "pcie->icc_mem"
is NULL and "pm_suspend_target_state == PM_SUSPEND_MEM".  Silence this
warning by initializing ret to zero.

Fixes: 78b5f6f8855e ("PCI: qcom: Add OPP support to scale performance")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Manivannan Sadhasivam July 9, 2024, 5:15 a.m. UTC | #1
On Mon, Jul 08, 2024 at 01:05:38PM -0500, Dan Carpenter wrote:
> Smatch complains that "ret" could be uninitialized if "pcie->icc_mem"
> is NULL and "pm_suspend_target_state == PM_SUSPEND_MEM".  Silence this
> warning by initializing ret to zero.
> 
> 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 e06c4ad3a72a..74e2acf4ae11 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -1633,7 +1633,7 @@ static int qcom_pcie_probe(struct platform_device *pdev)
>  static int qcom_pcie_suspend_noirq(struct device *dev)
>  {
>  	struct qcom_pcie *pcie = dev_get_drvdata(dev);
> -	int ret;
> +	int ret = 0;
>  
>  	/*
>  	 * Set minimum bandwidth required to keep data path functional during
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index e06c4ad3a72a..74e2acf4ae11 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -1633,7 +1633,7 @@  static int qcom_pcie_probe(struct platform_device *pdev)
 static int qcom_pcie_suspend_noirq(struct device *dev)
 {
 	struct qcom_pcie *pcie = dev_get_drvdata(dev);
-	int ret;
+	int ret = 0;
 
 	/*
 	 * Set minimum bandwidth required to keep data path functional during