]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: ethernet: avoid using unitialized memory
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Mon, 12 Jan 2026 11:02:24 +0000 (12:02 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 12 Jan 2026 23:23:38 +0000 (00:23 +0100)
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 19b8d391a95d5a2fa038551a9498a9fd426dfc0e)

target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c

index 59ae4fbb2403e7d80e6feebf02be8da4c49e863b..db5349648840c529b1ecfd907c68352257f89070 100644 (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;