]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: ethernet: mtk_eth_soc: fix error handling in mtk_open()
authorLiu Jian <liujian56@huawei.com>
Thu, 17 Nov 2022 11:13:56 +0000 (19:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:40:00 +0000 (17:40 +0100)
commitda86a63479e5743d8d631bd813a6f0b45423d4ef
treefe242e9b5a72688db75977167e10ffc9761851fd
parent756534f7cf53f35e9e098c15a6e341f27b5888d9
net: ethernet: mtk_eth_soc: fix error handling in mtk_open()

[ Upstream commit f70074140524c59a0935947b06dd6cb6e1ea642d ]

If mtk_start_dma() fails, invoke phylink_disconnect_phy() to perform
cleanup. phylink_disconnect_phy() contains the put_device action. If
phylink_disconnect_phy is not performed, the Kref of netdev will leak.

Fixes: b8fc9f30821e ("net: ethernet: mediatek: Add basic PHYLINK support")
Signed-off-by: Liu Jian <liujian56@huawei.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20221117111356.161547-1-liujian56@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mediatek/mtk_eth_soc.c