power: supply: bq25980: Fix uninitialized wd_reg_val
authorDan Murphy <dmurphy@ti.com>
Tue, 6 Oct 2020 17:30:07 +0000 (12:30 -0500)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Thu, 8 Oct 2020 21:58:15 +0000 (23:58 +0200)
Fix the uninitialized wd_reg_val if the for..loop was not successful in
finding an appropriate match.

Fixes: 5069185fc18e ("power: supply: bq25980: Add support for the BQ259xx family")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq25980_charger.c

index f04f9ac..db69ec4 100644 (file)
@@ -1096,7 +1096,7 @@ static int bq25980_power_supply_init(struct bq25980_device *bq,
 static int bq25980_hw_init(struct bq25980_device *bq)
 {
        struct power_supply_battery_info bat_info = { };
-       int wd_reg_val;
+       int wd_reg_val = 0;
        int ret = 0;
        int curr_val;
        int volt_val;