mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: davinci: vpbe: missing clk_put
@ 2014-11-06 13:04 Sudip Mukherjee
  2014-11-07 12:08 ` Prabhakar Lad
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2014-11-06 13:04 UTC (permalink / raw)
  To: Lad, Prabhakar, Mauro Carvalho Chehab
  Cc: Sudip Mukherjee, linux-media, linux-kernel

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 <sudip@vectorindia.org>
---
 drivers/media/platform/davinci/vpbe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c
index 49d2de0..e5df991 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: davinci: vpbe: missing clk_put
  2014-11-06 13:04 [PATCH] media: davinci: vpbe: missing clk_put Sudip Mukherjee
@ 2014-11-07 12:08 ` Prabhakar Lad
  0 siblings, 0 replies; 2+ messages in thread
From: Prabhakar Lad @ 2014-11-07 12:08 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Mauro Carvalho Chehab, linux-media, LKML

Hi,

Thanks for the patch!

On Thu, Nov 6, 2014 at 1:04 PM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
> 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 <sudip@vectorindia.org>

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Thanks,
--Prabhakar

> ---
>  drivers/media/platform/davinci/vpbe.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c
> index 49d2de0..e5df991 100644
> --- a/drivers/media/platform/davinci/vpbe.c
> +++ b/drivers/media/platform/davinci/vpbe.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-07 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-06 13:04 [PATCH] media: davinci: vpbe: missing clk_put Sudip Mukherjee
2014-11-07 12:08 ` Prabhakar Lad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®