Commit 592600a0 authored by Auke Kok's avatar Auke Kok Committed by Auke Kok

e1000: check return value of _get_speed_and_duplex

We were not checking the return value of get_speed_and_duplex
properly, whih may contain an error value.
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: default avatarAuke Kok <auke-jan.h.kok@intel.com>
parent ee04022a
...@@ -2737,8 +2737,12 @@ e1000_check_for_link(struct e1000_hw *hw) ...@@ -2737,8 +2737,12 @@ e1000_check_for_link(struct e1000_hw *hw)
*/ */
if(hw->tbi_compatibility_en) { if(hw->tbi_compatibility_en) {
uint16_t speed, duplex; uint16_t speed, duplex;
e1000_get_speed_and_duplex(hw, &speed, &duplex); ret_val = e1000_get_speed_and_duplex(hw, &speed, &duplex);
if(speed != SPEED_1000) { 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 /* If link speed is not set to gigabit speed, we do not need
* to enable TBI compatibility. * to enable TBI compatibility.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment