Re: [PATCH net 2/2] net: mana: Skip redundant detach in queue reset handler if already detached

From: Jakub Kicinski

Date: Wed May 20 2026 - 20:17:53 EST


On Mon, 18 May 2026 12:43:51 -0700 Dipayaan Roy wrote:
> + /* If already detached (indicates detach succeeded but attach failed
> + * previously). Now skip mana detach and just retry mana_attach.
> + */
> + if (!netif_device_present(ndev))
> + goto attach;
> +
> err = mana_detach(ndev, false);
> if (err) {
> netdev_err(ndev, "mana_detach failed: %d\n", err);
> goto dealloc_pre_rxbufs;
> }
>
> +attach:

goto's are acceptable for error unwinding, not to jump around
a function seemingly to avoid indenting something. Please use
normal constructs or perhaps move the netif_device_present()
into mana_detach() as an early exit condition?

> err = mana_attach(ndev);