Re: [PATCH net v2] ieee802154: keep the original error after a netns rollback
From: Miquel Raynal
Date: Fri Nov 20 2026 - 03:25:57 EST
On 20/11/2026 at 07:57:49 +01, Andrey Misiurov <amisiurov@xxxxxxxxxxxxxx> wrote:
> cfg802154_switch_netns() moves all of a phy's netdevs into a new netns. If
> one move fails, it jumps to the errout label and moves the already-moved
> netdevs back to the old netns.
>
> That rollback loop overwrites the same 'err' variable with the result of
> each move-back. The move-backs succeed, so 'err' ends up 0 and the function
> returns 0 -- success -- even though nothing moved and the phy stayed in the
> old netns. nl802154_wpan_phy_netns() then tells userspace the move worked.
>
> Give the rollback loop its own 'err' so the original error survives and is
> returned.
>
> Fixes: 66e5c2672cd1 ("ieee802154: add netns support")
> Signed-off-by: Andrey Misiurov <amisiurov@xxxxxxxxxxxxxx>
Reviewed-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>