From 36d3bea3a96348d0657e2503da55d23743cb3e55 Mon Sep 17 00:00:00 2001 From: Gennaro Cimmino Date: Sun, 13 Sep 2026 08:28:03 +0200 Subject: [PATCH] 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 Link: https://github.com/openwrt/openwrt/pull/25145 Signed-off-by: Markus Stockhausen --- target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c index a50edc54e7b..f81ee170cee 100644 --- a/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c +++ b/target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/l3.c @@ -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; }