Files
linux/drivers
Miaoqian Lin 41ed613642 power: supply: ab8500: Fix memory leak in ab8500_fg_sysfs_init
[ Upstream commit 6a4760463d ]

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-15 14:18:12 +02:00
..
2022-04-15 14:18:10 +02:00
2021-07-14 16:53:42 +02:00
2022-03-08 19:07:46 +01:00
2022-03-02 11:41:10 +01:00