diff options
author | Nikolay Aleksandrov <nikolay@redhat.com> | 2012-09-14 05:50:03 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-13 05:28:05 +0900 |
commit | b89ea13784c385483ef3a47a992f92842171f5c1 (patch) | |
tree | 6d31752679d7609eab7c28c1f18edea43cf32c10 | |
parent | c56a0fd7b6d69ef122a01b9b1db83ba62c9f6622 (diff) | |
download | kernel_samsung_tuna-b89ea13784c385483ef3a47a992f92842171f5c1.zip kernel_samsung_tuna-b89ea13784c385483ef3a47a992f92842171f5c1.tar.gz kernel_samsung_tuna-b89ea13784c385483ef3a47a992f92842171f5c1.tar.bz2 |
netxen: check for root bus in netxen_mask_aer_correctable
[ Upstream commit e4d1aa40e363ed3e0486aeeeb0d173f7f822737e ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index c0788a3..78d5b67 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@ -1288,6 +1288,10 @@ static void netxen_mask_aer_correctable(struct netxen_adapter *adapter) struct pci_dev *root = pdev->bus->self; u32 aer_pos; + /* root bus? */ + if (!root) + return; + if (adapter->ahw.board_type != NETXEN_BRDTYPE_P3_4_GB_MM && adapter->ahw.board_type != NETXEN_BRDTYPE_P3_10G_TP) return; |