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>
This commit is contained in:
		
							parent
							
								
									e488921f44
								
							
						
					
					
						commit
						e4d1aa40e3
					
				| @ -1378,6 +1378,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; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user