[media] V4L: soc_camera_platform: do not leave dangling invalid pointers
[pandora-kernel.git] / drivers / media / video / soc_camera_platform.c
index f5ebe59..c8f6b18 100644 (file)
@@ -173,7 +173,9 @@ evdrs:
 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);