media: sti/hva: add missing clk_disable_unprepare()
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 20 Jan 2021 08:47:20 +0000 (09:47 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 27 Jan 2021 07:34:09 +0000 (08:34 +0100)
Fixes this smatch warning:

drivers/media/platform/sti/hva/hva-hw.c:453 hva_hw_runtime_resume() warn: 'hva->clk' not released on lines: 450.

Call clk_disable_unprepare() when clk_set_rate() fails.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/sti/hva/hva-hw.c

index 43f279e..f59811e 100644 (file)
@@ -447,6 +447,7 @@ int hva_hw_runtime_resume(struct device *dev)
        if (clk_set_rate(hva->clk, CLK_RATE)) {
                dev_err(dev, "%s     failed to set clock frequency\n",
                        HVA_PREFIX);
+               clk_disable_unprepare(hva->clk);
                return -EINVAL;
        }