From: Jonathan Cooper Date: Tue, 28 Jun 2022 13:59:32 +0000 (+0100) Subject: sfc: Change BUG_ON to WARN_ON and recovery code. X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b3fd0a86dad2f574b5196829d5881a940c0d0cb1;p=linux.git sfc: Change BUG_ON to WARN_ON and recovery code. Pre-emptively fix a checkpatch warning in a subsequent patch. Signed-off-by: Jonathan Cooper Co-developed-by: Martin Habets Signed-off-by: Martin Habets Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 955271ff06bb7..dead69025bf5e 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -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));