linux-sg2042/drivers/powercap
Yang Yingliang 7d8914c998 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:32:56 +01:00
..
Kconfig powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
Makefile powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
dtpm.c powercap: DTPM: Fix spelling mistake "initialze" -> "initialize" 2022-03-01 18:59:35 +01:00
dtpm_cpu.c Power management updates for 5.20-rc1 2022-08-02 11:17:00 -07:00
dtpm_devfreq.c powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
dtpm_subsys.h powercap/drivers/dtpm: Add dtpm devfreq with energy model support 2022-02-04 17:38:09 +01:00
idle_inject.c sched: Add TASK_ANY for wait_task_inactive() 2022-09-07 21:53:49 +02:00
intel_rapl_common.c powercap: intel_rapl: Use standard Energy Unit for SPR Dram RAPL domain 2022-09-24 19:32:46 +02:00
intel_rapl_msr.c powercap: RAPL: Add Power Limit4 support for Alder Lake-N and Raptor Lake-P 2022-07-26 20:58:28 +02:00
powercap_sys.c powercap: fix possible name leak in powercap_register_zone() 2023-03-10 09:32:56 +01:00