Author: jhb
Date: Thu Mar  1 22:13:10 2012
New Revision: 232367
URL: http://svn.freebsd.org/changeset/base/232367

Log:
  Properly handle failures in igb_setup_msix() by returning 0 if MSI or MSI-X
  allocation fails.
  
  Reviewed by:  jfv
  MFC after:    2 weeks

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c Thu Mar  1 21:23:26 2012        (r232366)
+++ head/sys/dev/e1000/if_igb.c Thu Mar  1 22:13:10 2012        (r232367)
@@ -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);
 }
 
 /*********************************************************************
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to