Skip to content
Commit 854617f5 authored by Siddharth Vadapalli's avatar Siddharth Vadapalli Committed by Jakub Kicinski
Browse files

net: ethernet: ti: am65-cpsw: Handle -EPROBE_DEFER for Serdes PHY



In the am65_cpsw_init_serdes_phy() function, the error handling for the
call to the devm_of_phy_get() function misses the case where the return
value of devm_of_phy_get() is ERR_PTR(-EPROBE_DEFER). Proceeding without
handling this case will result in a crash when the "phy" pointer with
this value is dereferenced by phy_init() in am65_cpsw_enable_phy().

Fix this by adding appropriate error handling code.

Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Fixes: dab2b265

 ("net: ethernet: ti: am65-cpsw: Add support for SERDES configuration")
Suggested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarSiddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: default avatarRoger Quadros <rogerq@kernel.org>
Link: https://lore.kernel.org/r/20230118112136.213061-1-s-vadapalli@ti.com
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a76e88c2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment