Skip to content

Commit 9553636

Browse files
Dan Carpenterkwilczynski
authored andcommitted
PCI: qcom: Prevent potential error pointer dereference
Only call dev_pm_opp_put() if dev_pm_opp_find_freq_exact() succeeds; otherwise it leads to an error pointer dereference. Fixes: 78b5f6f ("PCI: qcom: Add OPP support to scale performance") Link: https://lore.kernel.org/linux-pci/[email protected] Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Tested-by: Anders Roxell <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]>
1 parent 101e5c5 commit 9553636

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/controller/dwc/pcie-qcom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1447,8 +1447,8 @@ static void qcom_pcie_icc_opp_update(struct qcom_pcie *pcie)
14471447
if (ret)
14481448
dev_err(pci->dev, "Failed to set OPP for freq (%lu): %d\n",
14491449
freq_kbps * width, ret);
1450+
dev_pm_opp_put(opp);
14501451
}
1451-
dev_pm_opp_put(opp);
14521452
}
14531453
}
14541454

0 commit comments

Comments
 (0)