public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] staging: most: video: replace BUG_ON with WARN_ON_ONCE
@ 2026-03-06  1:17 Iman Reihanian
  2026-03-08 18:45 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Iman Reihanian @ 2026-03-06  1:17 UTC (permalink / raw)
  To: parthiban.veerasooran, christian.gromm
  Cc: gregkh, linux-staging, linux-kernel, Iman Reihanian

BUG_ON causes a kernel panic if the condition is true, which is
too severe for this cleanup check on module exit. Replace it with
WARN_ON_ONCE to emit a warning and allow the system to continue.

Signed-off-by: Iman Reihanian <ireihani@uci.edu>
---
 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 04351f8ccccf..279ec98aa70e 100644
--- a/drivers/staging/most/video/video.c
+++ b/drivers/staging/most/video/video.c
@@ -577,7 +577,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));
 }
 
 module_init(comp_init);
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: most: video: replace BUG_ON with WARN_ON_ONCE
  2026-03-06  1:17 [PATCH] staging: most: video: replace BUG_ON with WARN_ON_ONCE Iman Reihanian
@ 2026-03-08 18:45 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-03-08 18:45 UTC (permalink / raw)
  To: Iman Reihanian
  Cc: parthiban.veerasooran, christian.gromm, linux-staging,
	linux-kernel, Iman Reihanian

On Thu, Mar 05, 2026 at 05:17:40PM -0800, Iman Reihanian wrote:
> BUG_ON causes a kernel panic if the condition is true, which is
> too severe for this cleanup check on module exit. Replace it with
> WARN_ON_ONCE to emit a warning and allow the system to continue.
> 
> Signed-off-by: Iman Reihanian <ireihani@uci.edu>
> ---
>  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 04351f8ccccf..279ec98aa70e 100644
> --- a/drivers/staging/most/video/video.c
> +++ b/drivers/staging/most/video/video.c
> @@ -577,7 +577,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));

This really doesn't "solve" anything, does it?  If panic-on-warn is
enabled, you still crashed the machine :(

How about fixing the root cause if this could ever happen?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-08 18:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-06  1:17 [PATCH] staging: most: video: replace BUG_ON with WARN_ON_ONCE Iman Reihanian
2026-03-08 18:45 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox