From: Auke Kok Date: Tue, 27 Jun 2006 16:08:09 +0000 (-0700) Subject: e1000: check return value of _get_speed_and_duplex X-Git-Tag: v2.6.18-rc2~255^2~1^2~6 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=592600a0536f0d5aab4dc95f19515a37d03430f8;p=linux-2.6 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: Jesse Brandeburg Signed-off-by: Auke Kok --- diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index 37eb351b4c..784f950586 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c @@ -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. */