From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
mchehab@kernel.org, hverkuil@xs4all.nl
Subject: Re: [PATCH 2/2] media: v4l2-async: Safely unregister an non-registered async subdev
Date: Mon, 1 Mar 2021 10:33:08 +0200 [thread overview]
Message-ID: <20210301083308.GS3@paasikivi.fi.intel.com> (raw)
In-Reply-To: <20210226224938.18166-2-laurent.pinchart@ideasonboard.com>
Hi Laurent,
On Sat, Feb 27, 2021 at 12:49:38AM +0200, Laurent Pinchart wrote:
> From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
>
> Make the V4L2 async framework a bit more robust by allowing to
> unregister a non-registered async subdev. Otherwise the
> v4l2_async_cleanup() will attempt to delete the async subdev from the
> subdev_list with the corresponding list_head not initialized.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
IMO this can be merged through another tree once the first patch is agreed
on. Cc Hans and Mauro, too.
> ---
> drivers/media/v4l2-core/v4l2-async.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
> index 37cc0263b273..2347b7ac54d4 100644
> --- a/drivers/media/v4l2-core/v4l2-async.c
> +++ b/drivers/media/v4l2-core/v4l2-async.c
> @@ -750,6 +750,9 @@ EXPORT_SYMBOL(v4l2_async_register_subdev);
>
> void v4l2_async_unregister_subdev(struct v4l2_subdev *sd)
> {
> + if (list_is_null(&sd->async_list))
> + return;
> +
> mutex_lock(&list_lock);
>
> __v4l2_async_notifier_unregister(sd->subdev_notifier);
--
Kind regards,
Sakari Ailus
next prev parent reply other threads:[~2021-03-01 8:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-26 22:49 [PATCH 1/2] list: Add list_is_null() to check if a list_head has been initialized Laurent Pinchart
2021-02-26 22:49 ` [PATCH 2/2] media: v4l2-async: Safely unregister an non-registered async subdev Laurent Pinchart
2021-03-01 8:33 ` Sakari Ailus [this message]
2021-02-27 9:14 ` [PATCH 1/2] list: Add list_is_null() to check if a list_head has been initialized Sergei Shtylyov
2021-03-01 8:31 ` Sakari Ailus
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=20210301083308.GS3@paasikivi.fi.intel.com \
--to=sakari.ailus@linux.intel.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mchehab@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
all inboxes | Powered by JetHome®