From: Sakari Ailus <sakari.ailus@iki.fi>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, hverkuil@xs4all.nl, hdegoede@redhat.com
Subject: Re: [PATCH] v4l: Don't access media entity after is has been destroyed
Date: Wed, 15 Jun 2011 20:23:03 +0300 [thread overview]
Message-ID: <4DF8EA77.4000404@iki.fi> (raw)
In-Reply-To: <1308126986-7679-1-git-send-email-laurent.pinchart@ideasonboard.com>
Laurent Pinchart wrote:
> 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.
Thanks for the patch, Laurent!
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
--
Sakari Ailus
sakari.ailus@iki.fi
next prev parent reply other threads:[~2011-06-15 17:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 11:22 Crash on unplug with the uvc driver in linuxtv/staging/for_v3.1 Hans de Goede
2011-06-11 9:16 ` Laurent Pinchart
2011-06-13 9:41 ` Laurent Pinchart
2011-06-13 11:10 ` Hans Verkuil
2011-06-13 16:09 ` Laurent Pinchart
2011-06-15 8:36 ` [PATCH] v4l: Don't access media entity after is has been destroyed Laurent Pinchart
2011-06-15 8:37 ` Laurent Pinchart
2011-06-15 17:23 ` Sakari Ailus [this message]
2011-06-16 9:03 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DF8EA77.4000404@iki.fi \
--to=sakari.ailus@iki.fi \
--cc=hdegoede@redhat.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.