From: Dan Carpenter <dan.carpenter@linaro.org>
To: Pavan Kumar Yalagada <pavankumaryalagada@gmail.com>
Cc: parthiban.veerasooran@microchip.com,
christian.gromm@microchip.com, gregkh@linuxfoundation.org,
laurent.pinchart+renesas@ideasonboard.com,
hverkuil+cisco@kernel.org, linux-staging@lists.linux.dev
Subject: Re: [PATCH] staging: most: video: replace BUG_ON() with WARN_ON_ONCE()
Date: Mon, 24 Nov 2025 11:05:14 +0300 [thread overview]
Message-ID: <aSQRugdpdJjWe1S9@stanley.mountain> (raw)
In-Reply-To: <20251121190909.115556-1-pavankumaryalagada@gmail.com>
On Fri, Nov 21, 2025 at 02:09:09PM -0500, Pavan Kumar Yalagada wrote:
> checkpatch.pl recommends replacing BUG_ON() with WARN_ON_ONCE()
> to avoid a kernel panic.
>
> Signed-off-by: Pavan Kumar Yalagada <pavankumaryalagada@gmail.com>
> ---
> drivers/staging/most/video/video.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
> index 32f71d9a9cf7..3a622bd597e6 100644
> --- a/drivers/staging/most/video/video.c
> +++ b/drivers/staging/most/video/video.c
> @@ -575,7 +575,7 @@ static void __exit comp_exit(void)
>
> most_deregister_configfs_subsys(&comp);
> most_deregister_component(&comp);
> - BUG_ON(!list_empty(&video_devices));
> + WARN_ON_ONCE(!list_empty(&video_devices));
The start of the function empties the list. So the list would only
not be empty if something were adding new entries to it via the
comp_probe_channel() function.
So what is preventing us from adding new stuff once comp_exit()
starts being called? Figure that bit out. Fix the bug, don't
add a warning about the bug.
regards,
dan carpenter
prev parent reply other threads:[~2025-11-24 8:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-21 19:09 [PATCH] staging: most: video: replace BUG_ON() with WARN_ON_ONCE() Pavan Kumar Yalagada
2025-11-22 6:50 ` Greg KH
2025-11-24 8:05 ` 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=aSQRugdpdJjWe1S9@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-staging@lists.linux.dev \
--cc=parthiban.veerasooran@microchip.com \
--cc=pavankumaryalagada@gmail.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;
as well as URLs for NNTP newsgroup(s).