diff options
author | Laurent Pinchart <[email protected]> | 2011-06-15 05:20:34 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <[email protected]> | 2011-06-30 23:12:36 -0300 |
commit | c064b8eac8da5d494fd221f14219c4f39502deb2 (patch) | |
tree | f0c3c04d8ee9940d86076ffded0afa78dcca8e7b /net/lapb/lapb_timer.c | |
parent | ca4186f06fecbf2b692a42cdea54b7ef23b2496c (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 <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions