Skip to content

Commit

Permalink
[media] V4L: soc_camera_platform: do not leave dangling invalid pointers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Nov 3, 2011
1 parent 3dcc731 commit fff96b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/video/soc_camera_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ static int soc_camera_platform_probe(struct platform_device *pdev)
static int soc_camera_platform_remove(struct platform_device *pdev)
{
struct soc_camera_platform_priv *priv = get_priv(pdev);
struct soc_camera_platform_info *p = v4l2_get_subdevdata(&priv->subdev);

p->icd->control = NULL;
v4l2_device_unregister_subdev(&priv->subdev);
platform_set_drvdata(pdev, NULL);
kfree(priv);
Expand Down

0 comments on commit fff96b6

Please sign in to comment.