Skip to content

Commit

Permalink
sfc: don't BUG_ON efx->max_channels == 0 in probe
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
ecree-solarflare authored and davem330 committed Nov 3, 2014
1 parent c495d64 commit 9fd3d3a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/sfc/ef10.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9fd3d3a

Please sign in to comment.