[PATCH v2] ov9640: fix OmniVision OV9640 sensor driver's I2C remove function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <dacohen@xxxxxxxxx>
---
 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux