Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power_supply: 88pm860x_charger: Decrement the power supply's device reference counter

Use power_supply_put() to decrement the power supply's device reference
counter.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Sebastian Reichel
52016ac0 67273a1b

+9 -2
+9 -2
drivers/power/88pm860x_charger.c
··· 298 298 return -EINVAL; 299 299 ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_VOLTAGE_NOW, 300 300 &data); 301 - if (ret) 301 + if (ret) { 302 + power_supply_put(psy); 302 303 return ret; 304 + } 303 305 vbatt = data.intval / 1000; 304 306 305 307 ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_PRESENT, &data); 306 - if (ret) 308 + if (ret) { 309 + power_supply_put(psy); 307 310 return ret; 311 + } 312 + power_supply_put(psy); 308 313 309 314 mutex_lock(&info->lock); 310 315 info->present = data.intval; ··· 452 447 453 448 set_charging_fsm(info); 454 449 out: 450 + power_supply_put(psy); 455 451 return IRQ_HANDLED; 456 452 } 457 453 ··· 513 507 514 508 out: 515 509 mutex_unlock(&info->lock); 510 + power_supply_put(psy); 516 511 dev_dbg(info->dev, "%s, Allowed: %d\n", __func__, info->allowed); 517 512 set_charging_fsm(info); 518 513