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: Steve Pfetsch <spfetsch@google.com> Signed-off-by: Cykeek <Cykeek@proton.me>
Loading
Please register or sign in to comment