power: supply: bq256xx: Fix BQ256XX_NUM_WD_VAL and bq256xx_watchdog_time[] overrun
authorRicardo Rivera-Matos <r-rivera-matos@ti.com>
Wed, 13 Jan 2021 22:53:52 +0000 (16:53 -0600)
committerSebastian Reichel <sre@kernel.org>
Thu, 14 Jan 2021 22:38:56 +0000 (23:38 +0100)
commitc3f1813516477c014d41e207d95190daf0838107
tree628f48c8d5f43a0c2a62330c8fd7b90ec70cf4cd
parentb059b48500dab78cb6c7be006280dbc001c0a46b
power: supply: bq256xx: Fix BQ256XX_NUM_WD_VAL and bq256xx_watchdog_time[] overrun

Corrects BQ256XX_NUM_WD_VAL from value of "8" to "4" and fixes the issue when 'i'
is equal to array size then array index over runs the array

Fixes: 32e4978bb920 ("power: supply: bq256xx: Introduce the BQ256XX charger driver")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ricardo Rivera-Matos <r-rivera-matos@ti.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq256xx_charger.c