diff options
author | Nikolay Aleksandrov <nikolay@redhat.com> | 2012-09-14 01:50:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-18 16:22:08 -0400 |
commit | e4d1aa40e363ed3e0486aeeeb0d173f7f822737e (patch) | |
tree | 8b787165d2d0eb6514033afe925f308a98cea920 /drivers/net | |
parent | e488921f44765e8ab6c48ca35e3f6b78df9819df (diff) |
netxen: check for root bus in netxen_mask_aer_correctable
Add a check if pdev->bus->self == NULL (root bus). When attaching
a netxen NIC to a VM it can be on the root bus and the guest would
crash in netxen_mask_aer_correctable() because of a NULL pointer
dereference if CONFIG_PCIEAER is present.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c index 342b3a79bd0f..a77c558d8f40 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c | |||
@@ -1378,6 +1378,10 @@ static void netxen_mask_aer_correctable(struct netxen_adapter *adapter) | |||
1378 | struct pci_dev *root = pdev->bus->self; | 1378 | struct pci_dev *root = pdev->bus->self; |
1379 | u32 aer_pos; | 1379 | u32 aer_pos; |
1380 | 1380 | ||
1381 | /* root bus? */ | ||
1382 | if (!root) | ||
1383 | return; | ||
1384 | |||
1381 | if (adapter->ahw.board_type != NETXEN_BRDTYPE_P3_4_GB_MM && | 1385 | if (adapter->ahw.board_type != NETXEN_BRDTYPE_P3_4_GB_MM && |
1382 | adapter->ahw.board_type != NETXEN_BRDTYPE_P3_10G_TP) | 1386 | adapter->ahw.board_type != NETXEN_BRDTYPE_P3_10G_TP) |
1383 | return; | 1387 | return; |