From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: linux-media@vger.kernel.org, Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: jacopo.mondi@ideasonboard.com
Subject: Re: [PATCH 2/2] media: v4l: async: Properly check for a notifier initialised or registered
Date: Thu, 14 Mar 2024 15:04:44 +0100 [thread overview]
Message-ID: <8691787.DvuYhMxLoT@steina-w> (raw)
In-Reply-To: <20240311121741.1249976-3-sakari.ailus@linux.intel.com>
Hi Sakari,
I suppose on of your intentions of this series is to replace my patch, no?
Am Montag, 11. März 2024, 13:17:41 CET schrieb Sakari Ailus:
> Properly check that a notifier was never initialised or register. This can
> now be done by looking at the entry in the notifier list, not the V4L2
> device or sub-device that are set in the initialiser now.
>
> Fixes: b8ec754ae4c5 ("media: v4l: async: Set v4l2_device and subdev in async notifier init")
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> drivers/media/v4l2-core/v4l2-async.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
> index 2ff35d5d60f2..3b43d6285dfe 100644
> --- a/drivers/media/v4l2-core/v4l2-async.c
> +++ b/drivers/media/v4l2-core/v4l2-async.c
> @@ -630,12 +630,14 @@ EXPORT_SYMBOL(v4l2_async_nf_register);
> static void
> __v4l2_async_nf_unregister(struct v4l2_async_notifier *notifier)
> {
> - if (!notifier || (!notifier->v4l2_dev && !notifier->sd))
> + /* Return here if the notifier is never initialised or registered. */
> + if (!notifier->notifier_entry.next ||
I don't like the idea checking the next pointer of a list.
Despite that it's not even necessary.
Best regards,
Alexander
> + list_empty(¬ifier->notifier_entry))
> return;
>
> v4l2_async_nf_unbind_all_subdevs(notifier);
>
> - list_del(¬ifier->notifier_entry);
> + list_del_init(¬ifier->notifier_entry);
> }
>
> void v4l2_async_nf_unregister(struct v4l2_async_notifier *notifier)
>
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
next prev parent reply other threads:[~2024-03-14 14:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 12:17 [PATCH 0/2] V4L2 async fixes Sakari Ailus
2024-03-11 12:17 ` [PATCH 1/2] media: v4l: async: Don't set notifier's V4L2 device if registering fails Sakari Ailus
2024-03-11 12:17 ` [PATCH 2/2] media: v4l: async: Properly check for a notifier initialised or registered Sakari Ailus
2024-03-14 14:04 ` Alexander Stein [this message]
2024-03-20 7:07 ` Sakari Ailus
2024-03-21 8:28 ` Alexander Stein
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=8691787.DvuYhMxLoT@steina-w \
--to=alexander.stein@ew.tq-group.com \
--cc=jacopo.mondi@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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