提交 fff96b66 编写于 作者: G Guennadi Liakhovetski 提交者: Mauro Carvalho Chehab

[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: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 3dcc731a
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册