summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc/uvc_entity.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-06-15 05:20:34 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-06-30 23:12:36 -0300
commitc064b8eac8da5d494fd221f14219c4f39502deb2 (patch)
treef0c3c04d8ee9940d86076ffded0afa78dcca8e7b /drivers/media/video/uvc/uvc_entity.c
parentca4186f06fecbf2b692a42cdea54b7ef23b2496c (diff)
[media] v4l: Don't access media entity after is has been destroyed
Entities associated with video device nodes are unregistered in video_unregister_device(). This destroys the entity even though it can still be accessed through open video device nodes. Move the media_device_unregister_entity() call from video_unregister_device() to v4l2_device_release() to ensure that the entity isn't unregistered until the last reference to the video device is released. Also remove the media_entity_get()/put() calls from v4l2-dev.c. Those functions were designed for subdevs, to avoid a parent module from being removed while still accessible through board code. They're not currently needed for video device nodes, and will oops when a hotpluggable device is disconnected during streaming, as media_entity_put() called in v4l2_device_release() tries to access entity->parent->dev->driver which is set to NULL when the device is disconnected. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_entity.c')
0 files changed, 0 insertions, 0 deletions