From: Myeonghun Pak <hidden> Date: 2026-09-13 01:21:56
tg3_get_invariants() can register an MDIO bus and connect a PHY for
USE_PHYLIB devices. If tg3_init_one() later fails, its common error path
releases the mappings and netdev without undoing those PHYLIB resources.
Disconnect the PHY and unregister the MDIO bus before the remaining
teardown. The existing IS_CONNECTED and MDIOBUS_INITED flags make both
helpers safe when initialization only completed partially.
This issue was identified during our ongoing static-analysis research while
reviewing kernel code.
Fixes: 158d7abdae85 ("tg3: Add mdio bus registration")
Assisted-by: OpenAI:GPT-5.6
Co-developed-by: Ijae Kim <redacted>
Signed-off-by: Ijae Kim <redacted>
Signed-off-by: Myeonghun Pak <redacted>
---
drivers/net/ethernet/broadcom/tg3.c | 5 +++++
1 file changed, 5 insertions(+)
From: Andrew Lunn <andrew@lunn.ch> Date: 2026-09-14 20:10:42
On Sat, Sep 12, 2026 at 09:21:48PM -0400, Myeonghun Pak wrote:
quoted hunk
tg3_get_invariants() can register an MDIO bus and connect a PHY for
USE_PHYLIB devices. If tg3_init_one() later fails, its common error path
releases the mappings and netdev without undoing those PHYLIB resources.
Disconnect the PHY and unregister the MDIO bus before the remaining
teardown. The existing IS_CONNECTED and MDIOBUS_INITED flags make both
helpers safe when initialization only completed partially.
This issue was identified during our ongoing static-analysis research while
reviewing kernel code.
Fixes: 158d7abdae85 ("tg3: Add mdio bus registration")
Assisted-by: OpenAI:GPT-5.6
Co-developed-by: Ijae Kim <redacted>
Signed-off-by: Ijae Kim <redacted>
Signed-off-by: Myeonghun Pak <redacted>
---
drivers/net/ethernet/broadcom/tg3.c | 5 +++++
1 file changed, 5 insertions(+)
From: Myeonghun Pak <hidden> Date: 2026-09-14 22:19:26
Hi Andrew,
I'll remove the redundant USE_PHYLIB check in v2, as both cleanup
helpers already check their initialization flags.
Thanks,
Myeonghun
2026년 9월 14일 (월) 오후 4:10, Andrew Lunn [off-list ref]님이 작성:
On Sat, Sep 12, 2026 at 09:21:48PM -0400, Myeonghun Pak wrote:
quoted
tg3_get_invariants() can register an MDIO bus and connect a PHY for
USE_PHYLIB devices. If tg3_init_one() later fails, its common error path
releases the mappings and netdev without undoing those PHYLIB resources.
Disconnect the PHY and unregister the MDIO bus before the remaining
teardown. The existing IS_CONNECTED and MDIOBUS_INITED flags make both
helpers safe when initialization only completed partially.
This issue was identified during our ongoing static-analysis research while
reviewing kernel code.
Fixes: 158d7abdae85 ("tg3: Add mdio bus registration")
Assisted-by: OpenAI:GPT-5.6
Co-developed-by: Ijae Kim <redacted>
Signed-off-by: Ijae Kim <redacted>
Signed-off-by: Myeonghun Pak <redacted>
---
drivers/net/ethernet/broadcom/tg3.c | 5 +++++
1 file changed, 5 insertions(+)