]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sfc: Change BUG_ON to WARN_ON and recovery code.
authorJonathan Cooper <jonathan.s.cooper@amd.com>
Tue, 28 Jun 2022 13:59:32 +0000 (14:59 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jun 2022 12:40:47 +0000 (13:40 +0100)
Pre-emptively fix a checkpatch warning in a subsequent patch.

Signed-off-by: Jonathan Cooper <jonathan.s.cooper@amd.com>
Co-developed-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/efx.c

index 955271ff06bb7cd65fecf6aa11174fabefa280b2..dead69025bf5e537b2756e3e35bed914d7ac4201 100644 (file)
@@ -774,7 +774,8 @@ static void efx_unregister_netdev(struct efx_nic *efx)
        if (!efx->net_dev)
                return;
 
-       BUG_ON(netdev_priv(efx->net_dev) != efx);
+       if (WARN_ON(netdev_priv(efx->net_dev) != efx))
+               return;
 
        if (efx_dev_registered(efx)) {
                strlcpy(efx->name, pci_name(efx->pci_dev), sizeof(efx->name));