Skip to contentSkip to conversation

soc/tegra: fuse: Fix index bug in get_process_id

PATCH In review Nicolin Chen 2 participants 2 messages Nov 19, 2020 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc/tegra: fuse: Fix index bug in get_process_id

This patch simply fixes a bug of referencing speedos[num] in every for-loop iteration in get_process_id function.

Fixes 0dc5a0d83675 ("soc/tegra: fuse: Add Tegra210 support")
---
 drivers/soc/tegra/fuse/speedo-tegra210.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/fuse/speedo-tegra210.c +1 -1
index 7394a8d694cb..695d0b7f9a8a 100644
@@ -94,7 +94,7 @@ static int get_process_id(int value, const u32 *speedos, unsigned int num)
 	unsigned int i;
 
 	for (i = 0; i < num; i++)
-		if (value < speedos[num])
+		if (value < speedos[i])
 			return i;
 
 	return -EINVAL;
Signature · 1 line
2.17.1
#1 lore raw
Quoted 9 lines · Nicolin Chen

This patch simply fixes a bug of referencing speedos[num] in every for-loop iteration in get_process_id function.

Fixes 0dc5a0d83675 ("soc/tegra: fuse: Add Tegra210 support")
---
 drivers/soc/tegra/fuse/speedo-tegra210.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Good catch! Applied, thanks.

Thierry