ASoC: fix incomplete error-handling in img_i2s_in_probe.
authorQiushi Wu <wu000273@umn.edu>
Mon, 25 May 2020 05:50:11 +0000 (00:50 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 26 May 2020 16:20:23 +0000 (17:20 +0100)
Function "pm_runtime_get_sync()" is not handled by "pm_runtime_put()"
if "PTR_ERR(rst) == -EPROBE_DEFER". Fix this issue by adding
"pm_runtime_put()" into this error path.

Fixes: f65bb92ca12e ("ASoC: img-i2s-in: Add runtime PM")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Link: https://lore.kernel.org/r/20200525055011.31925-1-wu000273@umn.edu
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/img/img-i2s-in.c

index a495d1050d490f39116479c170550b9320986d46..e30b66b94bf67bb19bf960050291c6eca45e440e 100644 (file)
@@ -482,6 +482,7 @@ static int img_i2s_in_probe(struct platform_device *pdev)
        if (IS_ERR(rst)) {
                if (PTR_ERR(rst) == -EPROBE_DEFER) {
                        ret = -EPROBE_DEFER;
+                       pm_runtime_put(&pdev->dev);
                        goto err_suspend;
                }