android_kernel_xiaomi_sm8350/drivers/powercap
Yang Yingliang dbd6ae0956 powercap: fix possible name leak in powercap_register_zone()
[ Upstream commit 1b6599f741a4525ca761ecde46e5885ff1e6ba58 ]

In the error path after calling dev_set_name(), the device
name is leaked. To fix this, calling dev_set_name() before
device_register(), and call put_device() if it returns error.

All the resources is released in powercap_release(), so it
can return from powercap_register_zone() directly.

Fixes: 75d2364ea0 ("PowerCap: Add class driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-11 16:43:40 +01:00
..
idle_inject.c
intel_rapl_common.c
intel_rapl_msr.c
Kconfig
Makefile
powercap_sys.c