Skip to content

Commit d7b5c94

Browse files
committed
Merge tag 'for-v6.3-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull power supply fixes from Sebastian Reichel: - rk817: Fix compiler warning - cros_usbpd-charger: Fix excessive error printing - axp288_fuel_gauge: handle platform_get_irq error - bq24190 and da9150: Fix race condition in remove path * tag 'for-v6.3-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: supply: da9150: Fix use after free bug in da9150_charger_remove due to race condition power: supply: bq24190: Fix use after free bug in bq24190_remove due to race condition power: supply: axp288_fuel_gauge: Added check for negative values power: supply: cros_usbpd: reclassify "default case!" as debug power: supply: rk817: Fix unsigned comparison with less than zero
2 parents 37154c1 + 06615d1 commit d7b5c94

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

drivers/power/supply/axp288_fuel_gauge.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,8 @@ static int axp288_fuel_gauge_probe(struct platform_device *pdev)
724724

725725
for (i = 0; i < AXP288_FG_INTR_NUM; i++) {
726726
pirq = platform_get_irq(pdev, i);
727+
if (pirq < 0)
728+
continue;
727729
ret = regmap_irq_get_virq(axp20x->regmap_irqc, pirq);
728730
if (ret < 0)
729731
return dev_err_probe(dev, ret, "getting vIRQ %d\n", pirq);

drivers/power/supply/bq24190_charger.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,6 +1906,7 @@ static void bq24190_remove(struct i2c_client *client)
19061906
struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
19071907
int error;
19081908

1909+
cancel_delayed_work_sync(&bdi->input_current_limit_work);
19091910
error = pm_runtime_resume_and_get(bdi->dev);
19101911
if (error < 0)
19111912
dev_warn(bdi->dev, "pm_runtime_get failed: %i\n", error);

drivers/power/supply/cros_usbpd-charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static int cros_usbpd_charger_get_power_info(struct port_data *port)
276276
port->psy_current_max = 0;
277277
break;
278278
default:
279-
dev_err(dev, "Port %d: default case!\n", port->port_number);
279+
dev_dbg(dev, "Port %d: default case!\n", port->port_number);
280280
port->psy_usb_type = POWER_SUPPLY_USB_TYPE_SDP;
281281
}
282282

drivers/power/supply/da9150-charger.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ static int da9150_charger_remove(struct platform_device *pdev)
657657

658658
if (!IS_ERR_OR_NULL(charger->usb_phy))
659659
usb_unregister_notifier(charger->usb_phy, &charger->otg_nb);
660+
cancel_work_sync(&charger->otg_work);
660661

661662
power_supply_unregister(charger->battery);
662663
power_supply_unregister(charger->usb);

drivers/power/supply/rk817_charger.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,6 @@ rk817_read_or_set_full_charge_on_boot(struct rk817_charger *charger,
785785
regmap_bulk_read(rk808->regmap, RK817_GAS_GAUGE_Q_PRES_H3,
786786
bulk_reg, 4);
787787
tmp = get_unaligned_be32(bulk_reg);
788-
if (tmp < 0)
789-
tmp = 0;
790788
boot_charge_mah = ADC_TO_CHARGE_UAH(tmp,
791789
charger->res_div) / 1000;
792790
/*
@@ -825,8 +823,6 @@ rk817_read_or_set_full_charge_on_boot(struct rk817_charger *charger,
825823
regmap_bulk_read(rk808->regmap, RK817_GAS_GAUGE_Q_PRES_H3,
826824
bulk_reg, 4);
827825
tmp = get_unaligned_be32(bulk_reg);
828-
if (tmp < 0)
829-
tmp = 0;
830826
boot_charge_mah = ADC_TO_CHARGE_UAH(tmp, charger->res_div) / 1000;
831827
regmap_bulk_read(rk808->regmap, RK817_GAS_GAUGE_OCV_VOL_H,
832828
bulk_reg, 2);

0 commit comments

Comments
 (0)