Skip to content

Commit

Permalink
e1000: check return value of _get_speed_and_duplex
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Auke Kok authored and Auke Kok committed Jun 27, 2006
1 parent ee04022 commit 592600a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/net/e1000/e1000_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 592600a

Please sign in to comment.