[PATCH v2 02/10] net: fixed-link phys are never acquired

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixed-link phys have their bus field set to NULL. This causes a crash when
phy_acquired tries to check the slice of the bus.

Signed-off-by: Daniel Glöckner <dg@xxxxxxxxx>
---
 include/linux/phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/phy.h b/include/linux/phy.h
index e93f6a01f..3f0f31b35 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -370,7 +370,7 @@ void phy_write_mmd_indirect(struct phy_device *phydev, int prtad, int devad,
 
 static inline bool phy_acquired(struct phy_device *phydev)
 {
-	return phydev && slice_acquired(&phydev->bus->slice);
+	return phydev && phydev->bus && slice_acquired(&phydev->bus->slice);
 }
 
 #ifdef CONFIG_PHYLIB
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux