linux-stable/drivers/power
ruanjinjie 279af90e65 power: supply: fix null pointer dereferencing in power_supply_get_battery_info
[ Upstream commit 104bb8a663 ]

when kmalloc() fail to allocate memory in kasprintf(), propname
will be NULL, strcmp() called by of_get_property() will cause
null pointer dereference.

So return ENOMEM if kasprintf() return NULL pointer.

Fixes: 3afb50d712 ("power: supply: core: Add some helpers to use the battery OCV capacity table")
Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:26:30 +01:00
..
reset power supply and reset changes for the v6.0 series 2022-08-12 09:37:33 -07:00
supply power: supply: fix null pointer dereferencing in power_supply_get_battery_info 2022-12-31 13:26:30 +01: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