aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/osst.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2015-03-12 08:44:12 +0100
committerSebastian Reichel <sre@kernel.org>2015-03-13 23:15:52 +0100
commit1a352462b5377ac68f5955d674b3460c7bac52a3 (patch)
treeb2dbecd8b038ccaddd262af47efa4fdf64c75696 /drivers/scsi/osst.c
parent297d716f6260cc9421d971b124ca196b957ee458 (diff)
downloadlinux-1a352462b5377ac68f5955d674b3460c7bac52a3.tar.gz
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 <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>
Diffstat (limited to 'drivers/scsi/osst.c')
0 files changed, 0 insertions, 0 deletions