]> err.no Git - linux-2.6/commitdiff
e1000: check return value of _get_speed_and_duplex
authorAuke Kok <auke-jan.h.kok@intel.com>
Tue, 27 Jun 2006 16:08:09 +0000 (09:08 -0700)
committerAuke Kok <juke-jan.h.kok@intel.com>
Tue, 27 Jun 2006 16:08:09 +0000 (09:08 -0700)
We were not checking the return value of get_speed_and_duplex
properly, whih may contain an error value.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
drivers/net/e1000/e1000_hw.c

index 37eb351b4c9b6bb85f3d6ebdd3175c41106dc603..784f9505864a0a9d9a0a9057d8c3a3aff5b7d40a 100644 (file)
@@ -2737,8 +2737,12 @@ e1000_check_for_link(struct e1000_hw *hw)
          */
         if(hw->tbi_compatibility_en) {
             uint16_t speed, duplex;
-            e1000_get_speed_and_duplex(hw, &speed, &duplex);
-            if(speed != SPEED_1000) {
+            ret_val = e1000_get_speed_and_duplex(hw, &speed, &duplex);
+            if (ret_val) {
+                DEBUGOUT("Error getting link speed and duplex\n");
+                return ret_val;
+            }
+            if (speed != SPEED_1000) {
                 /* If link speed is not set to gigabit speed, we do not need
                  * to enable TBI compatibility.
                  */