media: davinci: vpbe: missing clk_put
PATCH 1/1 media: davinci: vpbe: missing clk_put
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]>
--- drivers/media/platform/davinci/vpbe.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/platform/davinci/vpbe.c +1 -0
@@ -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; } }
Signature · 1 line
1.8.1.2
Hi,
Thanks for the patch!
Quoted 8 lines · Sudip Mukherjee
we are getting struct clk using
clk_getbefore callingclk_prepare_enable. but ifclk_prepare_enablefails, then we are jumping tofail_mutex_unlockwhere we are just unlocking the mutex, but we are not freeing the clock source.
this patch just adds a call toclk_putbefore jumping tofail_mutex_unlock.Signed-off-by Sudip Mukherjee <[email protected]>
Acked-by Lad, Prabhakar <[email protected]>
Thanks,
--Prabhakar
Quoted 19 lines
--- drivers/media/platform/davinci/vpbe.c | 1 + 1 file changed, 1 insertion(+)drivers/media/platform/davinci/vpbe.c +1
-1@@ -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; } } --1.8.1.2