mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 15:33:28 +00:00
The kernel oopses in phy_lookup() due to 'phy->init_data' being NULL if we register PHYs from a device tree probing driver and then call phy_get() on a device that has no representation in the device tree (e.g. a PCI device). Checking the pointer before dereferening it and skipping an interation if it's NULL prevents this kernel oops. Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>