[media] V4L: omap1_camera: fix use after free

Author: Mathias Krause <minipli@googlemail.com>

Even though clk_put() is a no-op on most architectures it is not for
some ARM implementations. To not fail on those, release the clock timer
before freeing the surrounding structure.

This bug was spotted by the semantic patch tool coccinelle using the
script found at scripts/coccinelle/free/kfree.cocci.

More information about semantic patching is available at

Signed-off-by: Mathias Krause 
Signed-off-by: Guennadi Liakhovetski 
Signed-off-by: Mauro Carvalho Chehab 
 drivers/media/video/omap1_camera.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/video/omap1_camera.c b/drivers/media/video/omap1_camera.c
index 0a2fb2b..9ed1513 100644
--- a/drivers/media/video/omap1_camera.c
+++ b/drivers/media/video/omap1_camera.c
@@ -1664,10 +1664,10 @@ static int __exit omap1_cam_remove(struct platform_device *pdev)
 	res = pcdev->res;
 	release_mem_region(res->start, resource_size(res));
-	kfree(pcdev);
+	kfree(pcdev);
 	dev_info(&pdev->dev, "OMAP1 Camera Interface driver unloaded\n");
 	return 0;