Skip to content
Commit f4cb4a93 authored by jonghyun26.kim's avatar jonghyun26.kim Committed by Your Name
Browse files

power_supply: Fix unbalanced the power supplies


If a driver invokes multiple power_supply_register(), the each supply
will not be saved in the supplied_from[] with the correct index.

supplied_from[0] = "dc"
num_supplies = 1;

supplied_from[0] = "usb"
num_supplies = 2;

supplied_from[0] = "battery"
num_supplies = 3;
...

It results in NPE when iterating the supplied_from[] with num_supplies on
__power_supply_is_supplied_by()

Bug: 63785418
Change-Id: Ifd14ca7c6e2df247e1090e4fa8d8c66bd2912180
Signed-off-by; Devin Kim <dojip.kim@lge.com>
Signed-off-by: default avatarSteve Pfetsch <spfetsch@google.com>
Signed-off-by: default avatarCykeek <Cykeek@proton.me>
parent 177f190c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment