]> git.ipfire.org Git - thirdparty/openwrt.git/commit
rtl8367b: fix RTL8367S-VB vlan mc memory handling 23970/head
authorMieczyslaw Nalewaj <namiltd@yahoo.com>
Sat, 27 Jun 2026 15:13:09 +0000 (17:13 +0200)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sun, 28 Jun 2026 20:25:30 +0000 (22:25 +0200)
commitbeb880855c3f5011b2a9cf5428061d7ce62a74ff
treead0ff7965866286851c3f60077a7cb23d7062cb8
parent0d892f17c92ad3693d438282188a2d99b9dadeee
rtl8367b: fix RTL8367S-VB vlan mc memory handling

The RTL8367S-VB (Family D) uses a software-emulated VLAN MC table
(emu_vlanmc) since it lacks hardware support for the VLAN MC registers
used by earlier chips.

- Add missing NULL check after kzalloc() in rtl8367b_init_regs() to
  prevent NULL pointer dereference on allocation failure.
- Add missing kfree(smi->emu_vlanmc) in rtl8367b_remove() to prevent
  memory leak on driver unload.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/23970
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/generic/files/drivers/net/phy/rtl8367b.c