[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <165573355435.2982.8611156918090702221.stgit@palantir17.mph.net>
Date: Mon, 20 Jun 2022 14:59:14 +0100
From: Martin Habets <habetsm.xilinx@...il.com>
To: jonathan.s.cooper@....com, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, edumazet@...gle.com
Cc: netdev@...r.kernel.org, ecree.xilinx@...il.com
Subject: [PATCH net-next 5/8] sfc: Fix checkpatch warning
From: Jonathan Cooper <jonathan.s.cooper@....com>
WARNING:AVOID_BUG: Avoid crashing the kernel - try using WARN_ON & recovery code
rather than BUG() or BUG_ON()
Signed-off-by: Jonathan Cooper <jonathan.s.cooper@....com>
Co-authored-by: Martin Habets <habetsm.xilinx@...il.com>
---
drivers/net/ethernet/sfc/efx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 08922ba35917..f874835e1764 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(efx_netdev_priv(efx->net_dev) != efx);
+ if (WARN_ON(efx_netdev_priv(efx->net_dev) != efx))
+ return;
if (efx_dev_registered(efx)) {
strlcpy(efx->name, pci_name(efx->pci_dev), sizeof(efx->name));
Powered by blists - more mailing lists