* [PATCH net] sfc: don't BUG_ON efx->max_channels == 0 in probe
@ 2014-11-03 14:14 Edward Cree
2014-11-03 20:58 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Edward Cree @ 2014-11-03 14:14 UTC (permalink / raw)
To: davem; +Cc: netdev, sshah, linux-net-drivers
efx_ef10_probe() was BUGging out if the BAR2 size was 0. This is
unnecessarily violent; instead we should just fail to probe the device.
Kept a WARN_ON as this problem indicates a broken or misconfigured NIC.
Signed-off-by: Edward Cree <ecree@solarflare.com>
---
drivers/net/ethernet/sfc/ef10.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 002d4cd..a77f05c 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -180,7 +180,8 @@ static int efx_ef10_probe(struct efx_nic *efx)
EFX_MAX_CHANNELS,
resource_size(&efx->pci_dev->resource[EFX_MEM_BAR]) /
(EFX_VI_PAGE_SIZE * EFX_TXQ_TYPES));
- BUG_ON(efx->max_channels == 0);
+ if (WARN_ON(efx->max_channels == 0))
+ return -EIO;
nic_data = kzalloc(sizeof(*nic_data), GFP_KERNEL);
if (!nic_data)
--
1.7.11.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-03 20:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03 14:14 [PATCH net] sfc: don't BUG_ON efx->max_channels == 0 in probe Edward Cree
2014-11-03 20:58 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox