Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe()

gic_probe() calls pm_runtime_get_sync() and added fail path as
rpm_put to put usage_counter. However, pm_runtime_get_sync()
will increment usage_counter even it failed. Fix it by replacing it with
pm_runtime_resume_and_get() to keep usage counter balanced.

Fixes: 9c8edddfc992 ("irqchip/gic: Add platform driver for non-root GICs that require RPM")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221124065150.22809-1-shangxiaojing@huawei.com

authored by

Shang XiaoJing and committed by
Marc Zyngier
f9ee20c8 915649da

+1 -1
+1 -1
drivers/irqchip/irq-gic-pm.c
··· 102 102 103 103 pm_runtime_enable(dev); 104 104 105 - ret = pm_runtime_get_sync(dev); 105 + ret = pm_runtime_resume_and_get(dev); 106 106 if (ret < 0) 107 107 goto rpm_disable; 108 108