aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-09-05 12:50:27 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-03 16:28:45 -0400
commitfff96b6685d6fec14deaacbce9e27fbb8feed53d (patch)
tree997c654039059454731f7b5466d2dc2a088d589b
parent3dcc731a93679d75a1f90a969b34aa9d7acd1cbf (diff)
[media] V4L: soc_camera_platform: do not leave dangling invalid pointers
The life-time of soc-camera device objects can be longer, than the time, it is attached to a client driver, therefore all references to the driver own data have to be cleared, when the driver is detached. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/soc_camera_platform.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/soc_camera_platform.c b/drivers/media/video/soc_camera_platform.c
index f5ebe59a555..c8f6b188496 100644
--- a/drivers/media/video/soc_camera_platform.c
+++ b/drivers/media/video/soc_camera_platform.c
@@ -173,7 +173,9 @@ evdrs:
173static int soc_camera_platform_remove(struct platform_device *pdev) 173static int soc_camera_platform_remove(struct platform_device *pdev)
174{ 174{
175 struct soc_camera_platform_priv *priv = get_priv(pdev); 175 struct soc_camera_platform_priv *priv = get_priv(pdev);
176 struct soc_camera_platform_info *p = v4l2_get_subdevdata(&priv->subdev);
176 177
178 p->icd->control = NULL;
177 v4l2_device_unregister_subdev(&priv->subdev); 179 v4l2_device_unregister_subdev(&priv->subdev);
178 platform_set_drvdata(pdev, NULL); 180 platform_set_drvdata(pdev, NULL);
179 kfree(priv); 181 kfree(priv);