Skip to content

Commit f0ae868

Browse files
Dan Carpentervinodkoul
authored andcommitted
phy: HiSilicon: Fix copy and paste bug in error handling
This should check ">pmctrl" instead of "->sysctrl". This bug could potentially lead to a crash if we dereference the error pointer. Fixes: 7307501 ("phy: HiSilicon: Add driver for Kirin 970 PCIe PHY") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Mauro Carvalho Chehab <[email protected]> Link: https://lore.kernel.org/r/20211117074843.GE5237@kili Signed-off-by: Vinod Koul <[email protected]>
1 parent a1b6c81 commit f0ae868

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/phy/hisilicon/phy-hi3670-pcie.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,8 @@ static int hi3670_pcie_phy_get_resources(struct hi3670_pcie_phy *phy,
757757
return PTR_ERR(phy->sysctrl);
758758

759759
phy->pmctrl = syscon_regmap_lookup_by_compatible("hisilicon,hi3670-pmctrl");
760-
if (IS_ERR(phy->sysctrl))
761-
return PTR_ERR(phy->sysctrl);
760+
if (IS_ERR(phy->pmctrl))
761+
return PTR_ERR(phy->pmctrl);
762762

763763
/* clocks */
764764
phy->phy_ref_clk = devm_clk_get(dev, "phy_ref");

0 commit comments

Comments
 (0)