thermal/drivers/k3_j72xx_bandgap: Fix array underflow in prep_lookup_table()

This while loop exits with "i" set to -1 and so then it sets:

	derived_table[-1] = derived_table[0] - 300;

There is no need for this assignment at all.  Just delete it.

Fixes: 72b3fc61c752 ("thermal: k3_j72xx_bandgap: Add the bandgap driver support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YoetjwcOEzYEFp9b@kili
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
This commit is contained in:
Dan Carpenter 2022-05-20 18:02:39 +03:00 committed by Daniel Lezcano
parent 99a049aace
commit cc67ca28cf
1 changed files with 0 additions and 2 deletions

View File

@ -151,8 +151,6 @@ static int prep_lookup_table(struct err_values *err_vals, int *ref_table)
/* 300 milli celsius steps */
while (i--)
derived_table[i] = derived_table[i + 1] - 300;
/* case 0 */
derived_table[i] = derived_table[i + 1] - 300;
}
/*