WSL2-Linux-Kernel/drivers/powercap
Yang Yingliang e4de2b98c4 powercap: fix possible name leak in powercap_register_zone()
[ Upstream commit 1b6599f741 ]

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-10 09:39:12 +01:00
..
Kconfig powercap/drivers/dtpm: Add the experimental label to the option description 2021-03-01 17:43:29 +01:00
Makefile powercap/drivers/dtpm: Add CPU energy model based support 2020-12-22 19:50:40 +01:00
dtpm.c powercap/drivers/dtpm: Fix root node initialization 2021-03-01 17:43:29 +01:00
dtpm_cpu.c powercap/drivers/dtpm: Fix size of object being allocated 2021-01-07 18:16:03 +01:00
idle_inject.c powercap: include header to fix -Wmissing-prototypes 2020-09-25 16:46:01 +02:00
intel_rapl_common.c powercap: intel_rapl: fix UBSAN shift-out-of-bounds issue 2022-10-26 12:35:30 +02:00
intel_rapl_msr.c powercap: Add Power Limit4 support for Alder Lake SoC 2021-08-25 20:12:16 +02:00
powercap_sys.c powercap: fix possible name leak in powercap_register_zone() 2023-03-10 09:39:12 +01:00