Skip to content

Commit a74c7a5

Browse files
minimaxwellkuba-moo
authored andcommitted
net: freescale: ucc_geth: Return early when TBI PHY can't be found
In ucc_geth's .mac_config(), we configure the TBI Serdes block represented by a struct phy_device that we get from firmware. While porting to phylink, a check was missed to make sure we don't try to access the TBI PHY if we can't get it. Let's add it and return early in case of error Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202601130843.rFGNXA5a-lkp@intel.com/ Fixes: 53036aa ("net: freescale: ucc_geth: phylink conversion") Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/20260114080247.366252-1-maxime.chevallier@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 2c68d5e commit a74c7a5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/net/ethernet/freescale/ucc_geth.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,8 +1602,10 @@ static void ugeth_mac_config(struct phylink_config *config, unsigned int mode,
16021602
pr_warn("TBI mode requires that the device tree specify a tbi-handle\n");
16031603

16041604
tbiphy = of_phy_find_device(ug_info->tbi_node);
1605-
if (!tbiphy)
1605+
if (!tbiphy) {
16061606
pr_warn("Could not get TBI device\n");
1607+
return;
1608+
}
16071609

16081610
value = phy_read(tbiphy, ENET_TBI_MII_CR);
16091611
value &= ~0x1000; /* Turn off autonegotiation */

0 commit comments

Comments
 (0)