Przeglądaj źródła

Merge branch 'pm-cpufreq'

* pm-cpufreq:
  cpufreq: fix overflow in cpufreq_table_find_index_dl()
Rafael J. Wysocki 8 lat temu
rodzic
commit
350d32395b
1 zmienionych plików z 2 dodań i 2 usunięć
  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)
 			return pos - table;
 
-		return best - pos;
+		return best - table;
 	}
 
-	return best - pos;
+	return best - table;
 }
 
 /* Works only on sorted freq-tables */