realtek: ethernet: avoid using unitialized memory
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled

The mac_addr variable was not zero-initialized, causing weird side effects
when the memory contents were a valid MAC address.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Link: https://github.com/openwrt/openwrt/pull/21504
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit 19b8d391a9)
This commit is contained in:
Carl-Daniel Hailfinger 2026-01-12 12:02:24 +01:00 committed by Hauke Mehrtens
parent 4542656411
commit d01aa41d40

View file

@ -1650,7 +1650,7 @@ static int __init rtl838x_eth_probe(struct platform_device *pdev)
struct resource *res, *mem;
phy_interface_t phy_mode;
struct phylink *phylink;
u8 mac_addr[ETH_ALEN];
u8 mac_addr[ETH_ALEN] = {0};
int err = 0, rxrings, rxringlen;
struct ring_b *ring;