[openwrt/openwrt] kernel: mv88e6xxx: backport fixes
LEDE Commits
lede-commits at lists.infradead.org
Sun Jan 4 07:42:54 PST 2026
hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9c4b7fbaadd6abb888c73617ec7791aadb0de4f6
commit 9c4b7fbaadd6abb888c73617ec7791aadb0de4f6
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Thu Jan 1 19:21:08 2026 +0100
kernel: mv88e6xxx: backport fixes
These patches fix bugs in a patch we backported.
These patch were cherry picked from upstream Linux because it references
a patch we backported in the fixes tag.
Fixes: c990f6e15669 ("linux: generic: net: dsa: mv88e6xxx LED support")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
...8e6xxx-fix-unreleased-fwnode_handle-in-se.patch | 31 ++++++++++
...8e6xxx-Fix-fwnode-reference-leaks-in-mv88.patch | 68 ++++++++++++++++++++++
...1-net-dsa-mv88e6xxx-disable-ATU-violation.patch | 2 +-
3 files changed, 100 insertions(+), 1 deletion(-)
diff --git a/target/linux/generic/backport-6.12/741-v6.13-net-dsa-mv88e6xxx-fix-unreleased-fwnode_handle-in-se.patch b/target/linux/generic/backport-6.12/741-v6.13-net-dsa-mv88e6xxx-fix-unreleased-fwnode_handle-in-se.patch
new file mode 100644
index 0000000000..2c81983a20
--- /dev/null
+++ b/target/linux/generic/backport-6.12/741-v6.13-net-dsa-mv88e6xxx-fix-unreleased-fwnode_handle-in-se.patch
@@ -0,0 +1,31 @@
+From b8ee7a11c75436b85fa1641aa5f970de0f8a575c Mon Sep 17 00:00:00 2001
+From: Javier Carrasco <javier.carrasco.cruz at gmail.com>
+Date: Sat, 19 Oct 2024 22:16:49 +0200
+Subject: net: dsa: mv88e6xxx: fix unreleased fwnode_handle in setup_port()
+
+'ports_fwnode' is initialized via device_get_named_child_node(), which
+requires a call to fwnode_handle_put() when the variable is no longer
+required to avoid leaking memory.
+
+Add the missing fwnode_handle_put() after 'ports_fwnode' has been used
+and is no longer required.
+
+Fixes: 94a2a84f5e9e ("net: dsa: mv88e6xxx: Support LED control")
+Signed-off-by: Javier Carrasco <javier.carrasco.cruz at gmail.com>
+Reviewed-by: Andrew Lunn <andrew at lunn.ch>
+Reviewed-by: Linus Walleij <linus.walleij at linaro.org>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/dsa/mv88e6xxx/chip.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/dsa/mv88e6xxx/chip.c
++++ b/drivers/net/dsa/mv88e6xxx/chip.c
+@@ -3441,6 +3441,7 @@ static int mv88e6xxx_setup_port(struct m
+ break;
+ }
+ }
++ fwnode_handle_put(ports_fwnode);
+ } else {
+ dev_dbg(chip->dev, "no ethernet ports node defined for the device\n");
+ }
diff --git a/target/linux/generic/backport-6.12/742-v6.17-net-dsa-mv88e6xxx-Fix-fwnode-reference-leaks-in-mv88.patch b/target/linux/generic/backport-6.12/742-v6.17-net-dsa-mv88e6xxx-Fix-fwnode-reference-leaks-in-mv88.patch
new file mode 100644
index 0000000000..6e0fbb82af
--- /dev/null
+++ b/target/linux/generic/backport-6.12/742-v6.17-net-dsa-mv88e6xxx-Fix-fwnode-reference-leaks-in-mv88.patch
@@ -0,0 +1,68 @@
+From f63e7c8a83892781f6ceb55566f9497639c44555 Mon Sep 17 00:00:00 2001
+From: Miaoqian Lin <linmq006 at gmail.com>
+Date: Mon, 1 Sep 2025 15:32:23 +0800
+Subject: net: dsa: mv88e6xxx: Fix fwnode reference leaks in
+ mv88e6xxx_port_setup_leds
+
+Fix multiple fwnode reference leaks:
+
+1. The function calls fwnode_get_named_child_node() to get the "leds" node,
+ but never calls fwnode_handle_put(leds) to release this reference.
+
+2. Within the fwnode_for_each_child_node() loop, the early return
+ paths that don't properly release the "led" fwnode reference.
+
+This fix follows the same pattern as commit d029edefed39
+("net dsa: qca8k: fix usages of device_get_named_child_node()")
+
+Fixes: 94a2a84f5e9e ("net: dsa: mv88e6xxx: Support LED control")
+Cc: stable at vger.kernel.org
+Signed-off-by: Miaoqian Lin <linmq006 at gmail.com>
+Reviewed-by: Linus Walleij <linus.walleij at linaro.org>
+Link: https://patch.msgid.link/20250901073224.2273103-1-linmq006@gmail.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ drivers/net/dsa/mv88e6xxx/leds.c | 17 +++++++++++++----
+ 1 file changed, 13 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/dsa/mv88e6xxx/leds.c
++++ b/drivers/net/dsa/mv88e6xxx/leds.c
+@@ -779,7 +779,8 @@ int mv88e6xxx_port_setup_leds(struct mv8
+ continue;
+ if (led_num > 1) {
+ dev_err(dev, "invalid LED specified port %d\n", port);
+- return -EINVAL;
++ ret = -EINVAL;
++ goto err_put_led;
+ }
+
+ if (led_num == 0)
+@@ -823,17 +824,25 @@ int mv88e6xxx_port_setup_leds(struct mv8
+ init_data.devname_mandatory = true;
+ init_data.devicename = kasprintf(GFP_KERNEL, "%s:0%d:0%d", chip->info->name,
+ port, led_num);
+- if (!init_data.devicename)
+- return -ENOMEM;
++ if (!init_data.devicename) {
++ ret = -ENOMEM;
++ goto err_put_led;
++ }
+
+ ret = devm_led_classdev_register_ext(dev, l, &init_data);
+ kfree(init_data.devicename);
+
+ if (ret) {
+ dev_err(dev, "Failed to init LED %d for port %d", led_num, port);
+- return ret;
++ goto err_put_led;
+ }
+ }
+
++ fwnode_handle_put(leds);
+ return 0;
++
++err_put_led:
++ fwnode_handle_put(led);
++ fwnode_handle_put(leds);
++ return ret;
+ }
diff --git a/target/linux/generic/hack-6.12/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch b/target/linux/generic/hack-6.12/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch
index b8d8652d8f..29ac3e9734 100644
--- a/target/linux/generic/hack-6.12/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch
+++ b/target/linux/generic/hack-6.12/711-net-dsa-mv88e6xxx-disable-ATU-violation.patch
@@ -9,7 +9,7 @@ Subject: [PATCH] net/dsa/mv88e6xxx: disable ATU violation
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
-@@ -3582,6 +3582,9 @@ static int mv88e6xxx_setup_port(struct m
+@@ -3583,6 +3583,9 @@ static int mv88e6xxx_setup_port(struct m
else
reg = 1 << port;
More information about the lede-commits
mailing list