mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-02 20:16:39 +07:00
[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>
This commit is contained in:
parent
3dcc731a93
commit
fff96b6685
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user