]> git.hungrycats.org Git - linux/commit
PM: QoS: Fix misc device registration unwind
authorYuho Choi <dbgh9129@gmail.com>
Mon, 8 Jun 2026 17:07:48 +0000 (13:07 -0400)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 9 Jun 2026 16:10:46 +0000 (18:10 +0200)
commit51a7c560cffdd3653ac2b930d01410569b23b23e
tree4aad011fa960a5c2320d21cff8a1e987b277679a
parent4549871118cf616eecdd2d939f78e3b9e1dddc48
PM: QoS: Fix misc device registration unwind

cpu_latency_qos_init() registers cpu_dma_latency first and, when
CONFIG_PM_QOS_CPU_SYSTEM_WAKEUP is enabled, registers cpu_wakeup_latency
afterwards. The second registration overwrites the first return value.

As a result, a failure to register cpu_dma_latency can be masked if the
second registration succeeds. Conversely, if cpu_dma_latency succeeds and
cpu_wakeup_latency fails, the function returns an error while leaving the
first misc device registered.

Return immediately on the first registration failure and deregister
cpu_dma_latency if the second registration fails.

Fixes: a4e6512a79d8 ("PM: QoS: Introduce a CPU system wakeup QoS limit")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
Link: https://patch.msgid.link/20260608170748.82273-1-dbgh9129@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/qos.c