]> Git Repo - linux.git/commitdiff
rt2800: validate step value for temperature compensation
authorStanislaw Gruszka <[email protected]>
Thu, 25 Oct 2012 07:51:39 +0000 (09:51 +0200)
committerJohn W. Linville <[email protected]>
Tue, 30 Oct 2012 19:58:54 +0000 (15:58 -0400)
Some hardware has correct (!= 0xff) value of tssi_bounds[4] in the
EEPROM, but step is equal to 0xff. This results on ridiculous delta
calculations and completely broke TX power settings.

Reported-and-tested-by: Pavel Lucik <[email protected]>
Cc: [email protected]
Signed-off-by: Stanislaw Gruszka <[email protected]>
Acked-by: Ivo van Doorn <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
drivers/net/wireless/rt2x00/rt2800lib.c

index 01dc8891070c3729c37b08cce18506ab583c4761..59474ae0aec0d14e7dfc2639c19cf65b82b3b7ea 100644 (file)
@@ -2449,7 +2449,7 @@ static int rt2800_get_gain_calibration_delta(struct rt2x00_dev *rt2x00dev)
        /*
         * Check if temperature compensation is supported.
         */
-       if (tssi_bounds[4] == 0xff)
+       if (tssi_bounds[4] == 0xff || step == 0xff)
                return 0;
 
        /*
This page took 0.067488 seconds and 4 git commands to generate.