From: Gabriel Rondon <grondon@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Christian Gromm <christian.gromm@microchip.com>,
Parthiban Veerasooran <parthiban.veerasooran@microchip.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH v2] staging: most: video: replace BUG_ON() with pr_warn() in comp_exit()
Date: Wed, 8 Apr 2026 12:28:18 +0100 [thread overview]
Message-ID: <20260408112818.95174-1-grondon@gmail.com> (raw)
Replace BUG_ON(!list_empty(&video_devices)) with an explicit check
and pr_warn() in the module exit function.
BUG_ON() is deprecated as it crashes the entire kernel on assertion
failure (see Documentation/process/deprecated.rst). WARN_ON() is
also inappropriate here since it crashes the system when
panic-on-warn is enabled. Use pr_warn() to log the unexpected
condition without any risk of crashing.
This is the last remaining BUG_ON() in the staging/most subsystem,
following the dim2 series that replaced five BUG_ON() calls.
Signed-off-by: Gabriel Rondon <grondon@gmail.com>
---
Changes since v1:
- Use pr_warn() instead of WARN_ON() to avoid crash with panic-on-warn
(Greg Kroah-Hartman)
drivers/staging/most/video/video.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
index 04351f8ccccf..c5425c207552 100644
--- a/drivers/staging/most/video/video.c
+++ b/drivers/staging/most/video/video.c
@@ -577,7 +577,8 @@ static void __exit comp_exit(void)
most_deregister_configfs_subsys(&comp);
most_deregister_component(&comp);
- BUG_ON(!list_empty(&video_devices));
+ if (!list_empty(&video_devices))
+ pr_warn("video_devices list not empty on exit\n");
}
module_init(comp_init);
--
2.33.0
next reply other threads:[~2026-04-08 11:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 11:28 Gabriel Rondon [this message]
2026-04-08 11:51 ` [PATCH v2] staging: most: video: replace BUG_ON() with pr_warn() in comp_exit() Greg Kroah-Hartman
2026-04-08 13:43 ` Gabriel Rondon
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=20260408112818.95174-1-grondon@gmail.com \
--to=grondon@gmail.com \
--cc=christian.gromm@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=parthiban.veerasooran@microchip.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