Skip to content

Commit eed70fd

Browse files
Russell Kingdavem330
authored andcommitted
net: phylink: fix failure to register on x86 systems
The kernel test robot reports a boot failure with qemu in 5.5-rc, referencing commit 2203cbf ("net: sfp: move fwnode parsing into sfp-bus layer"). This is caused by phylink_create() being passed a NULL fwnode, causing fwnode_property_get_reference_args() to return -EINVAL. Don't attempt to attach to a SFP bus if we have no fwnode, which avoids this issue. Reported-by: kernel test robot <[email protected]> Fixes: 2203cbf ("net: sfp: move fwnode parsing into sfp-bus layer") Signed-off-by: Russell King <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e64b274 commit eed70fd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/phy/phylink.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ static int phylink_register_sfp(struct phylink *pl,
566566
struct sfp_bus *bus;
567567
int ret;
568568

569+
if (!fwnode)
570+
return 0;
571+
569572
bus = sfp_bus_find_fwnode(fwnode);
570573
if (IS_ERR(bus)) {
571574
ret = PTR_ERR(bus);

0 commit comments

Comments
 (0)