[media] media: davinci: vpbe: missing clk_put
authorSudip Mukherjee <[email protected]>
Thu, 6 Nov 2014 13:04:27 +0000 (10:04 -0300)
committerMauro Carvalho Chehab <[email protected]>
Tue, 11 Nov 2014 10:48:21 +0000 (08:48 -0200)
we are getting struct clk using clk_get before calling
clk_prepare_enable. but if clk_prepare_enable fails, then we are
jumping to fail_mutex_unlock where we are just unlocking the mutex,
but we are not freeing the clock source.
this patch just adds a call to clk_put before jumping to
fail_mutex_unlock.

Signed-off-by: Sudip Mukherjee <[email protected]>
Acked-by: Lad, Prabhakar <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
drivers/media/platform/davinci/vpbe.c

index 49d2de0eea2d6c6e1fb7c3950b41e79f2de4277f..e5df9916b2a17a9a9dc78cc8bd0a9b8be8312b18 100644 (file)
@@ -625,6 +625,7 @@ static int vpbe_initialize(struct device *dev, struct vpbe_device *vpbe_dev)
                }
                if (clk_prepare_enable(vpbe_dev->dac_clk)) {
                        ret =  -ENODEV;
+                       clk_put(vpbe_dev->dac_clk);
                        goto fail_mutex_unlock;
                }
        }