From: Dongliang Mu Date: Tue, 19 Oct 2021 03:00:29 +0000 (+0200) Subject: media: driver: hva: add pm_runtime_disable in the error handling code of hva_hw_probe X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fb394f3fc8c32564d15e48f29e89b736b68441cd;p=linux.git media: driver: hva: add pm_runtime_disable in the error handling code of hva_hw_probe In the error handling code of hva_hw_probe, it fails to invoke pm_runtime_disable in many error sites. Fix this by adding a label err_disable with pm_runtime_disable and adjust one goto from label err_clk to err_disable. Signed-off-by: Dongliang Mu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/sti/hva/hva-hw.c b/drivers/media/platform/sti/hva/hva-hw.c index 15e8f83b1b564..fe4ea2e7f37e3 100644 --- a/drivers/media/platform/sti/hva/hva-hw.c +++ b/drivers/media/platform/sti/hva/hva-hw.c @@ -385,7 +385,7 @@ int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva) ret = pm_runtime_resume_and_get(dev); if (ret < 0) { dev_err(dev, "%s failed to set PM\n", HVA_PREFIX); - goto err_clk; + goto err_disable; } /* check IP hardware version */ @@ -403,6 +403,8 @@ int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva) err_pm: pm_runtime_put(dev); +err_disable: + pm_runtime_disable(dev); err_clk: if (hva->clk) clk_unprepare(hva->clk);