Linux Media Controller development
 help / color / mirror / Atom feed
From: Eugen Hristev <ehristev@kernel.org>
To: Cong Nguyen <congnt264@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: microchip-csi2dc: fix async notifier leak on probe error path
Date: Mon, 10 Aug 2026 19:39:54 +0300	[thread overview]
Message-ID: <4aaff8d6-573f-475f-aee4-f70decd5b521@kernel.org> (raw)
In-Reply-To: <20260808090729.2680734-1-congnt264@gmail.com>

On 8/8/26 12:07, Cong Nguyen wrote:
> csi2dc_of_parse() ends up calling csi2dc_prepare_notifier(), which
> registers the V4L2 async notifier with v4l2_async_nf_register(). The
> probe error label csi2dc_probe_cleanup_notifier is reached after
> csi2dc_of_parse() has already succeeded (e.g. when media entity init,
> csi2dc_power() or v4l2_async_register_subdev() fail), but it calls only
> v4l2_async_nf_cleanup() and never v4l2_async_nf_unregister().
> 
> The notifier therefore stays chained in the global notifier_list while
> the enclosing struct csi2dc_device is freed, leading to list corruption
> and a use-after-free when the list is next walked.
> 
> Unregister the notifier before cleaning it up on the error path,
> matching the teardown already done in csi2dc_remove().
> 
> Fixes: 2de0b3c0f678 ("media: atmel: introduce microchip csi2dc driver")
> Cc: stable@vger.kernel.org
> Assisted-by: Claude:claude-opus-4
> Signed-off-by: Cong Nguyen <congnt264@gmail.com>
> ---

Reviewed-by: Eugen Hristev <ehristev@kernel.org>

      reply	other threads:[~2026-08-10 16:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-08  9:07 [PATCH] media: microchip-csi2dc: fix async notifier leak on probe error path Cong Nguyen
2026-08-10 16:39 ` Eugen Hristev [this message]

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=4aaff8d6-573f-475f-aee4-f70decd5b521@kernel.org \
    --to=ehristev@kernel.org \
    --cc=congnt264@gmail.com \
    --cc=hverkuil@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@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