public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Myeonghun Pak <mhun512@gmail.com>
Cc: Horatiu Vultur <horatiu.vultur@microchip.com>,
	UNGLinuxDriver@microchip.com, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Ijae Kim <ae878000@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: lan966x: avoid unregistering netdev on register failure
Date: Mon, 4 May 2026 14:33:40 +0200	[thread overview]
Message-ID: <8bc1d1e5-6be5-4b4f-81cd-2571ef441275@lunn.ch> (raw)
In-Reply-To: <20260502050741.76945-1-mhun512@gmail.com>

> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> @@ -756,7 +756,7 @@ static void lan966x_cleanup_ports(struct lan966x *lan966x)
>  			unregister_netdev(port->dev);
>  
>  		lan966x_xdp_port_deinit(port);
> -		if (lan966x->fdma && lan966x->fdma_ndev == port->dev)
> +		if (lan966x->fdma && port->dev && lan966x->fdma_ndev == port->dev)
>  			lan966x_fdma_netdev_deinit(lan966x, port->dev);
>  
>  		if (port->phylink) {

Maybe this is better?

		port = lan966x->ports[p];
		if (!port || port->dev)
			continue;

		unregister_netdev(port->dev);

	Andrew

      reply	other threads:[~2026-05-04 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-02  5:07 [PATCH v2] net: lan966x: avoid unregistering netdev on register failure Myeonghun Pak
2026-05-04 12:33 ` Andrew Lunn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bc1d1e5-6be5-4b4f-81cd-2571ef441275@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=ae878000@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhun512@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox