OmniVision OV9640 driver wasn't deallocating properly its private data
as it was requesting the V4L2 subdev struct address instead of the priv
struct's one. This patch fixes such problem.

Signed-off-by: David Cohen <daco...@gmail.com>
---
 drivers/media/video/ov9640.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/ov9640.c b/drivers/media/video/ov9640.c
index 99e9e1d..1315696 100644
--- a/drivers/media/video/ov9640.c
+++ b/drivers/media/video/ov9640.c
@@ -791,7 +791,8 @@ static int ov9640_probe(struct i2c_client *client,
 
 static int ov9640_remove(struct i2c_client *client)
 {
-       struct ov9640_priv *priv = i2c_get_clientdata(client);
+       struct v4l2_subdev *sd = i2c_get_clientdata(client);
+       struct ov9640_priv *priv = container_of(sd, struct ov9640_priv, subdev);
 
        kfree(priv);
        return 0;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to