tmp_suning_uos_patched/drivers/power
Miaoqian Lin 879356a6a0 power: supply: ab8500: Fix memory leak in ab8500_fg_sysfs_init
[ Upstream commit 6a4760463dbc6b603690938c468839985189ce0a ]

kobject_init_and_add() takes reference even when it fails.
According to the doc of kobject_init_and_add():

   If this function returns an error, kobject_put() must be called to
   properly clean up the memory associated with the object.

Fix memory leak by calling kobject_put().

Fixes: 8c0984e5a7 ("power: move power supply drivers to power/supply")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 14:40:15 +02:00
..
reset power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe 2022-04-08 14:40:14 +02:00
supply power: supply: ab8500: Fix memory leak in ab8500_fg_sysfs_init 2022-04-08 14:40:15 +02:00
Kconfig PM: AVS: Drop the avs directory and the corresponding Kconfig 2020-10-22 18:39:32 +02:00
Makefile PM: AVS: Drop the avs directory and the corresponding Kconfig 2020-10-22 18:39:32 +02:00