mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-18 22:33:39 +00:00
Properly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X
allocation fails. Reviewed by: jfv MFC after: 2 weeks
This commit is contained in:
parent
78d763a29b
commit
c3173381be
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232367
|
@ -2711,7 +2711,7 @@ igb_setup_msix(struct adapter *adapter)
|
|||
"MSIX Configuration Problem, "
|
||||
"%d vectors configured, but %d queues wanted!\n",
|
||||
msgs, want);
|
||||
return (ENXIO);
|
||||
return (0);
|
||||
}
|
||||
if ((msgs) && pci_alloc_msix(dev, &msgs) == 0) {
|
||||
device_printf(adapter->dev,
|
||||
|
@ -2721,9 +2721,11 @@ igb_setup_msix(struct adapter *adapter)
|
|||
}
|
||||
msi:
|
||||
msgs = pci_msi_count(dev);
|
||||
if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0)
|
||||
device_printf(adapter->dev,"Using MSI interrupt\n");
|
||||
return (msgs);
|
||||
if (msgs == 1 && pci_alloc_msi(dev, &msgs) == 0) {
|
||||
device_printf(adapter->dev," Using MSI interrupt\n");
|
||||
return (msgs);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
Loading…
Reference in a new issue