30 Oct
2020
30 Oct
'20
3:32 p.m.
pm_runtime_get_sync() will increase pm usage counter even it failed. We should call pm_runtime_put_noidle to decrease it to prevent reference leak.
Signed-off-by: Zhang Qilong zhangqilong3@huawei.com --- sound/ac97/bus.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c index 7985dd8198b6..2c4779d851ad 100644 --- a/sound/ac97/bus.c +++ b/sound/ac97/bus.c @@ -521,8 +521,11 @@ static int ac97_bus_remove(struct device *dev) int ret;
ret = pm_runtime_get_sync(dev); - if (ret < 0) + if (ret < 0) { + dev_err(dev, "Failed to enable device: %d\n", ret); + pm_runtime_put_noidle(dev); return ret; + }
ret = adrv->remove(adev); pm_runtime_put_noidle(dev);
--
2.17.1