Browse Source

Merge branch 'pm-cpufreq'

* pm-cpufreq:
  cpufreq: fix overflow in cpufreq_table_find_index_dl()
Rafael J. Wysocki 8 years ago
parent
commit
350d32395b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      include/linux/cpufreq.h

+ 2 - 2
include/linux/cpufreq.h

@@ -677,10 +677,10 @@ static inline int cpufreq_table_find_index_dl(struct cpufreq_policy *policy,
 		if (best == table - 1)
 		if (best == table - 1)
 			return pos - table;
 			return pos - table;
 
 
-		return best - pos;
+		return best - table;
 	}
 	}
 
 
-	return best - pos;
+	return best - table;
 }
 }
 
 
 /* Works only on sorted freq-tables */
 /* Works only on sorted freq-tables */