From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
linux-media@vger.kernel.org,
Kieran Bingham <kieran.bingham@ideasonboard.com>,
linux-renesas-soc@vger.kernel.org,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Sylwester Nawrocki <snawrocki@kernel.org>
Subject: Re: [PATCH 1/4] v4l: async: fix unbind error in v4l2_async_notifier_unregister()
Date: Fri, 18 Aug 2017 14:13:17 +0300 [thread overview]
Message-ID: <3708304.dzPkAFdM1e@avalon> (raw)
In-Reply-To: <20170730223158.14405-2-niklas.soderlund+renesas@ragnatech.se>
Hi Niklas,
Thank you for the patch.
On Monday 31 Jul 2017 00:31:55 Niklas Söderlund wrote:
> The call to v4l2_async_cleanup() will set sd->asd to NULL so passing it
> to notifier->unbind() have no effect and leaves the notifier confused.
> Call the unbind() callback prior to cleaning up the subdevice to avoid
> this.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/v4l2-core/v4l2-async.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-async.c
> b/drivers/media/v4l2-core/v4l2-async.c index
> 851f128eba2219ad..0acf288d7227ba97 100644
> --- a/drivers/media/v4l2-core/v4l2-async.c
> +++ b/drivers/media/v4l2-core/v4l2-async.c
> @@ -226,14 +226,14 @@ void v4l2_async_notifier_unregister(struct
> v4l2_async_notifier *notifier)
>
> d = get_device(sd->dev);
>
> + if (notifier->unbind)
> + notifier->unbind(notifier, sd, sd->asd);
> +
> v4l2_async_cleanup(sd);
>
> /* If we handled USB devices, we'd have to lock the parent too
*/
> device_release_driver(d);
>
> - if (notifier->unbind)
> - notifier->unbind(notifier, sd, sd->asd);
> -
> /*
> * Store device at the device cache, in order to call
> * put_device() on the final step
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2017-08-18 11:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-30 22:31 [PATCH 0/4] v4l: async: fixes for v4l2_async_notifier_unregister() Niklas Söderlund
2017-07-30 22:31 ` [PATCH 1/4] v4l: async: fix unbind error in v4l2_async_notifier_unregister() Niklas Söderlund
2017-08-15 16:16 ` Sakari Ailus
2017-08-18 11:15 ` Laurent Pinchart
2017-08-18 13:42 ` Niklas Söderlund
2017-08-18 13:49 ` Sakari Ailus
2017-08-18 11:13 ` Laurent Pinchart [this message]
2017-07-30 22:31 ` [PATCH 2/4] v4l: async: abort if memory allocation fails when unregistering notifiers Niklas Söderlund
2017-08-24 16:20 ` Sakari Ailus
2017-07-30 22:31 ` [PATCH 3/4] v4l: async: do not hold list_lock when re-probing devices Niklas Söderlund
2017-07-30 22:31 ` [PATCH 4/4] v4l: async: add comment about re-probing to v4l2_async_notifier_unregister() Niklas Söderlund
2017-08-15 16:09 ` Sakari Ailus
2017-08-18 11:20 ` Laurent Pinchart
2017-08-18 13:42 ` Niklas Söderlund
2017-08-23 19:03 ` Niklas Söderlund
2017-08-24 7:59 ` Hans Verkuil
2017-08-24 16:17 ` Sakari Ailus
2017-08-25 9:17 ` Hans Verkuil
2017-07-31 8:04 ` [PATCH 0/4] v4l: async: fixes for v4l2_async_notifier_unregister() 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=3708304.dzPkAFdM1e@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil@xs4all.nl \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=sakari.ailus@linux.intel.com \
--cc=snawrocki@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).