diff --git a/devices/r8169/r8169_main-5.10-ethercat.c b/devices/r8169/r8169_main-5.10-ethercat.c index b00c04af..9c4b8b37 100644 --- a/devices/r8169/r8169_main-5.10-ethercat.c +++ b/devices/r8169/r8169_main-5.10-ethercat.c @@ -5093,7 +5093,9 @@ static void rtl_remove_one(struct pci_dev *pdev) rtl_release_firmware(tp); /* restore original MAC address */ - rtl_rar_set(tp, tp->dev->perm_addr); + if (is_valid_ether_addr(tp->dev->perm_addr)) { + rtl_rar_set(tp, tp->dev->perm_addr); + } } static const struct net_device_ops rtl_netdev_ops = { diff --git a/devices/r8169/r8169_main-5.14-ethercat.c b/devices/r8169/r8169_main-5.14-ethercat.c index 287bda91..7306ccd8 100644 --- a/devices/r8169/r8169_main-5.14-ethercat.c +++ b/devices/r8169/r8169_main-5.14-ethercat.c @@ -5071,7 +5071,9 @@ static void rtl_remove_one(struct pci_dev *pdev) rtl_release_firmware(tp); /* restore original MAC address */ - rtl_rar_set(tp, tp->dev->perm_addr); + if (is_valid_ether_addr(tp->dev->perm_addr)) { + rtl_rar_set(tp, tp->dev->perm_addr); + } } static const struct net_device_ops rtl_netdev_ops = { diff --git a/devices/r8169/r8169_main-5.15-ethercat.c b/devices/r8169/r8169_main-5.15-ethercat.c index 0e1f88f9..e115922a 100644 --- a/devices/r8169/r8169_main-5.15-ethercat.c +++ b/devices/r8169/r8169_main-5.15-ethercat.c @@ -5064,7 +5064,9 @@ static void rtl_remove_one(struct pci_dev *pdev) rtl_release_firmware(tp); /* restore original MAC address */ - rtl_rar_set(tp, tp->dev->perm_addr); + if (is_valid_ether_addr(tp->dev->perm_addr)) { + rtl_rar_set(tp, tp->dev->perm_addr); + } } static const struct net_device_ops rtl_netdev_ops = { diff --git a/devices/r8169/r8169_main-6.1-ethercat.c b/devices/r8169/r8169_main-6.1-ethercat.c index 3f4a77ca..f488fa84 100644 --- a/devices/r8169/r8169_main-6.1-ethercat.c +++ b/devices/r8169/r8169_main-6.1-ethercat.c @@ -4942,7 +4942,9 @@ static void rtl_remove_one(struct pci_dev *pdev) rtl_release_firmware(tp); /* restore original MAC address */ - rtl_rar_set(tp, tp->dev->perm_addr); + if (is_valid_ether_addr(tp->dev->perm_addr)) { + rtl_rar_set(tp, tp->dev->perm_addr); + } } static const struct net_device_ops rtl_netdev_ops = { diff --git a/devices/r8169/r8169_main-6.12-ethercat.c b/devices/r8169/r8169_main-6.12-ethercat.c index 9f81baf5..b1a31f50 100644 --- a/devices/r8169/r8169_main-6.12-ethercat.c +++ b/devices/r8169/r8169_main-6.12-ethercat.c @@ -5168,8 +5168,9 @@ static void rtl_shutdown(struct pci_dev *pdev) rtnl_unlock(); /* Restore original MAC address */ - rtl_rar_set(tp, tp->dev->perm_addr); - + if (is_valid_ether_addr(tp->dev->perm_addr)) { + rtl_rar_set(tp, tp->dev->perm_addr); + } if (system_state == SYSTEM_POWER_OFF && !tp->dash_enabled) { pci_wake_from_d3(pdev, tp->saved_wolopts); pci_set_power_state(pdev, PCI_D3hot); @@ -5202,7 +5203,9 @@ static void rtl_remove_one(struct pci_dev *pdev) rtl_release_firmware(tp); /* restore original MAC address */ - rtl_rar_set(tp, tp->dev->perm_addr); + if (is_valid_ether_addr(tp->dev->perm_addr)) { + rtl_rar_set(tp, tp->dev->perm_addr); + } } static const struct net_device_ops rtl_netdev_ops = { diff --git a/devices/r8169/r8169_main-6.4-ethercat.c b/devices/r8169/r8169_main-6.4-ethercat.c index f17815d8..5b2f1d9c 100644 --- a/devices/r8169/r8169_main-6.4-ethercat.c +++ b/devices/r8169/r8169_main-6.4-ethercat.c @@ -4984,7 +4984,9 @@ static void rtl_remove_one(struct pci_dev *pdev) rtl_release_firmware(tp); /* restore original MAC address */ - rtl_rar_set(tp, tp->dev->perm_addr); + if (is_valid_ether_addr(tp->dev->perm_addr)) { + rtl_rar_set(tp, tp->dev->perm_addr); + } } static const struct net_device_ops rtl_netdev_ops = {