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

HSI: Fix PM usage counter unbalance in ssi_hw_init

pm_runtime_get_sync will increment pm usage counter
even it failed. Forgetting to putting operation will
result in reference leak here. We fix it by replacing
it with pm_runtime_resume_and_get to keep usage counter
balanced.

Fixes: b209e047bc743 ("HSI: Introduce OMAP SSI driver")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>

authored by

Zhang Qilong and committed by
Sebastian Reichel
aa57e77b 5c8fe583

+1 -1
+1 -1
drivers/hsi/controllers/omap_ssi_core.c
··· 424 424 struct omap_ssi_controller *omap_ssi = hsi_controller_drvdata(ssi); 425 425 int err; 426 426 427 - err = pm_runtime_get_sync(ssi->device.parent); 427 + err = pm_runtime_resume_and_get(ssi->device.parent); 428 428 if (err < 0) { 429 429 dev_err(&ssi->device, "runtime PM failed %d\n", err); 430 430 return err;