]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: txgbe: fix phylink leak on AML init failure
authorChenguang Zhao <zhaochenguang@kylinos.cn>
Thu, 28 May 2026 01:32:58 +0000 (09:32 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 2 Jun 2026 02:27:20 +0000 (19:27 -0700)
Destroy the phylink instance when fixed-link setup fails.

Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Jiawen Wu <jiawenwu@trustnetic.com>
Link: https://patch.msgid.link/20260528013258.129146-1-zhaochenguang@kylinos.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/wangxun/txgbe/txgbe_aml.c

index da1d3976ed33528904fc5501664b5e05b3893528..72712cee1ab83453154df5801a84c8edb3c8d7e3 100644 (file)
@@ -517,6 +517,7 @@ int txgbe_phylink_init_aml(struct txgbe *txgbe)
        err = phylink_set_fixed_link(phylink, &state);
        if (err) {
                wx_err(wx, "Failed to set fixed link\n");
+               phylink_destroy(phylink);
                return err;
        }