Skip to content

Commit 15aca30

Browse files
Murad Masimovsre
authored andcommitted
power: supply: rt9467: Prevent using uninitialized local variable in rt9467_set_value_from_ranges()
There is a typo in rt9467_set_value_from_ranges() that can cause leaving local variable sel with an undefined value which is then used in regmap_field_write(). Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 6f7f70e ("power: supply: rt9467: Add Richtek RT9467 charger driver") Signed-off-by: Murad Masimov <m.masimov@mt-integration.ru> Link: https://patch.msgid.link/20251009145308.1830893-1-m.masimov@mt-integration.ru Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 8b27fe2 commit 15aca30

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/power/supply/rt9467-charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static int rt9467_set_value_from_ranges(struct rt9467_chg_data *data,
376376
if (rsel == RT9467_RANGE_VMIVR) {
377377
ret = linear_range_get_selector_high(range, value, &sel, &found);
378378
if (ret)
379-
value = range->max_sel;
379+
sel = range->max_sel;
380380
} else {
381381
linear_range_get_selector_within(range, value, &sel);
382382
}

0 commit comments

Comments
 (0)