mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-13 08:20:07 +00:00
32621086c3
Fixes CVE-2022-47522
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit d54c91bd9a
)
27 lines
680 B
Diff
27 lines
680 B
Diff
From: Felix Fietkau <nbd@nbd.name>
|
|
Date: Tue, 23 Nov 2021 17:01:45 +0100
|
|
Subject: [PATCH] Revert "of: net: pass the dst buffer to of_get_mac_address()"
|
|
|
|
This reverts commit 4932c5d80153c336c77dbe8d7af9f8fdd879d01f.
|
|
---
|
|
|
|
--- a/eeprom.c
|
|
+++ b/eeprom.c
|
|
@@ -107,9 +107,15 @@ mt76_eeprom_override(struct mt76_phy *ph
|
|
{
|
|
struct mt76_dev *dev = phy->dev;
|
|
|
|
+#ifdef CONFIG_OF
|
|
struct device_node *np = dev->dev->of_node;
|
|
+ const u8 *mac = NULL;
|
|
|
|
- of_get_mac_address(np, phy->macaddr);
|
|
+ if (np)
|
|
+ mac = of_get_mac_address(np);
|
|
+ if (!IS_ERR_OR_NULL(mac))
|
|
+ ether_addr_copy(phy->macaddr, mac);
|
|
+#endif
|
|
|
|
if (!is_valid_ether_addr(phy->macaddr)) {
|
|
eth_random_addr(phy->macaddr);
|