realtek: l3: unlock on the egress interface error path

otto_l3_alloc_egress_intf() returned without releasing ctrl->lock when
no egress interface slot was free. That lock is the DSA register mutex,
so every later register operation would have blocked on it.

The path cannot be reached at present: otto_l3_alloc_router_mac() guards
a pool of the same size, is filled at the same rate and runs first, so
it fails before this one can. The sibling function unlocks correctly on
the same condition, which is what this restores.

Found by code inspection, not reproduced on hardware.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25145
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
This commit is contained in:
Gennaro Cimmino authored and Markus Stockhausen committed 2026-09-13 10:34:52 +02:00
1 parent 5cfe1f9577
commit 36d3bea3a9
1 file changed
+1
@@ -785,6 +785,7 @@ static int otto_l3_alloc_egress_intf(struct otto_l3_ctrl *ctrl, u64 mac, int vla
if (free_mac < 0) {
dev_err(ctrl->dev, "No free egress interface, cannot offload\n");
mutex_unlock(ctrl->lock);
return -1;
}