linux/drivers/net/dsa/realtek
David Yang 056a5087d8 net: dsa: realtek: fix memory leak in rtl8366rb_setup_led()
led_classdev_register_ext() only reads init_data.devicename - it never
stores the pointer. However, the caller allocated devicename with
kasprintf() but never freed it, leaking the string memory.

Fix it with a stack buffer to avoid dynamic buffers completely.

Fixes: 32d6170054 ("net: dsa: realtek: add LED drivers for rtl8366rb")
Signed-off-by: David Yang <mmyangfl@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260618140200.1888707-1-mmyangfl@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-06-24 17:46:18 -07:00
..
Kconfig net: dsa: rtl8366rb: don't prompt users for LED control 2025-03-04 11:54:06 +01:00
Makefile net: dsa: realtek: rtl8365mb: add FDB support 2026-06-09 19:35:42 -07:00
realtek-mdio.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
realtek-mdio.h net: dsa: realtek: convert variants into real drivers 2024-02-12 10:42:16 +00:00
realtek-smi.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
realtek-smi.h net: dsa: realtek: convert variants into real drivers 2024-02-12 10:42:16 +00:00
realtek.h net: dsa: realtek: rtl8365mb: add bridge port flags 2026-06-09 19:35:42 -07:00
rtl83xx.c net: dsa: realtek: rtl8365mb: add bridge port flags 2026-06-09 19:35:42 -07:00
rtl83xx.h net: dsa: realtek: rtl8365mb: add bridge port flags 2026-06-09 19:35:42 -07:00
rtl8365mb_l2.c net: dsa: realtek: rtl8365mb: add FDB support 2026-06-09 19:35:42 -07:00
rtl8365mb_l2.h net: dsa: realtek: rtl8365mb: add FDB support 2026-06-09 19:35:42 -07:00
rtl8365mb_main.c net: dsa: realtek: rtl8365mb: add bridge port flags 2026-06-09 19:35:42 -07:00
rtl8365mb_table.c net: dsa: realtek: rtl8365mb: add table lookup interface 2026-06-09 19:35:41 -07:00
rtl8365mb_table.h net: dsa: realtek: rtl8365mb: add table lookup interface 2026-06-09 19:35:41 -07:00
rtl8365mb_vlan.c net: dsa: realtek: rtl8365mb: add VLAN support 2026-06-09 19:35:42 -07:00
rtl8365mb_vlan.h net: dsa: realtek: rtl8365mb: add VLAN support 2026-06-09 19:35:42 -07:00
rtl8366-core.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
rtl8366rb-leds.c net: dsa: realtek: fix memory leak in rtl8366rb_setup_led() 2026-06-24 17:46:18 -07:00
rtl8366rb.c net: dsa: realtek: Use %pM format specifier for MAC addresses 2026-06-04 18:12:45 -07:00
rtl8366rb.h net: dsa: rtl8366rb: Fix compilation problem 2025-02-24 09:14:42 +00:00