diff mbox

[media] OMAP1: fix use after free

Message ID 1296381958-15760-1-git-send-email-minipli@googlemail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Mathias Krause Jan. 30, 2011, 10:05 a.m. UTC
None
diff mbox

Patch

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);
-
 	clk_put(pcdev->clk);
 
+	kfree(pcdev);
+
 	dev_info(&pdev->dev, "OMAP1 Camera Interface driver unloaded\n");
 
 	return 0;