From: Dan Carpenter <dan.carpenter@linaro.org>
To: Minu Jin <s9430939@naver.com>
Cc: gregkh@linuxfoundation.org, christian.gromm@microchip.com,
parthiban.veerasooran@microchip.com, hverkuil+cisco@kernel.org,
laurent.pinchart+renesas@ideasonboard.com,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: most: video: fix potential race in list iteration
Date: Thu, 5 Feb 2026 08:45:16 +0300 [thread overview]
Message-ID: <aYQubHP2hsTUNik2@stanley.mountain> (raw)
In-Reply-To: <20260205021620.1165137-1-s9430939@naver.com>
On Thu, Feb 05, 2026 at 11:16:20AM +0900, Minu Jin wrote:
> There is a pattern in the loops where the lock is dropped
> to call a specific function and then re-acquired.
>
> The list can be exposed during this short gap, creating a potential
> race condition. This patch fixes the problem by replacing the list
> head with a local free list using list_replace_init(), instead of
> using the lock/unlock pattern in the loop.
>
> Signed-off-by: Minu Jin <s9430939@naver.com>
> ---
> Changes in v2:
> - Use list_replace_init() instead of moving one-by-one.
> (suggested by Dan Carpenter)
Thanks.
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
regards,
dan carpenter
prev parent reply other threads:[~2026-02-05 5:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 11:28 [PATCH] staging: most: video: fix potential race in list iteration Minu Jin
2026-02-04 9:35 ` Dan Carpenter
2026-02-05 2:16 ` [PATCH v2] " Minu Jin
2026-02-05 5:45 ` Dan Carpenter [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=aYQubHP2hsTUNik2@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=christian.gromm@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=hverkuil+cisco@kernel.org \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=parthiban.veerasooran@microchip.com \
--cc=s9430939@naver.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