aboutsummaryrefslogtreecommitdiff
path: root/net/lapb/lapb_iface.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <[email protected]>2015-03-12 08:44:12 +0100
committerSebastian Reichel <[email protected]>2015-03-13 23:15:52 +0100
commit1a352462b5377ac68f5955d674b3460c7bac52a3 (patch)
treeb2dbecd8b038ccaddd262af47efa4fdf64c75696 /net/lapb/lapb_iface.c
parent297d716f6260cc9421d971b124ca196b957ee458 (diff)
power_supply: Add power_supply_put for decrementing device reference counter
The power_supply_get_by_phandle() and power_supply_get_by_name() use function class_find_device() for obtaining the reference to power supply. Each use of class_find_device() increases the power supply's device reference counter. However the reference counter was not decreased by users of this API. Thus final device_unregister() call from power_supply_unregister() could not release the device and clean up its resources. This lead to memory leak if at least once power_supply_get_by_*() was called between registering and unregistering the power supply. Add and document new API power_supply_put() for decrementing the reference counter. Signed-off-by: Krzysztof Kozlowski <[email protected]> Acked-by: Pavel Machek <[email protected]> Reviewed-by: Bartlomiej Zolnierkiewicz <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
Diffstat (limited to 'net/lapb/lapb_iface.c')
0 files changed, 0 insertions, 0 deletions