staging: most: video: replace BUG_ON() with WARN_ON() in comp_exit()
Subsystems (2)
PATCH 1/1 staging: most: video: replace BUG_ON() with WARN_ON() in comp_exit()
Replace BUG_ON(!list_empty(&video_devices)) with WARN_ON() 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() logs the unexpected condition without bringing down the system.
This is the last remaining BUG_ON() in the staging/most subsystem, following the dim2 series that replaced five BUG_ON() calls.
--- drivers/staging/most/video/video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/most/video/video.c +1 -1
@@ -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 (!list_empty (&video_devices)); }module_init (comp_init);
Signature · 1 line
2.33.0
Greg Kroah-Hartman
maintainerQuoted 19 lines · Gabriel Rondon
Replace BUG_ON(!list_empty(&video_devices)) with
WARN_ON()in the module exit function.BUG_ON()is deprecated as it crashes the entire kernel on assertion failure (seeDocumentation/process/deprecated.rst).WARN_ON()logs the unexpected condition without bringing down the system.This is the last remaining
BUG_ON()in the staging/most subsystem, following the dim2 series that replaced fiveBUG_ON()calls.Signed-off-by Gabriel Rondon <[email protected]>--- drivers/staging/most/video/video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/most/video/video.c +0
-0
drivers/staging/most/video/video.c static void __exit comp_exit(void) · line 580
Quoted 5 lines
drivers/staging/most/video/video.c +1
-1@@ -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 (!list_empty (&video_devices));
WARN_ON() also crashes the system when panic-on-warn is enabled (as it is in a few billion Linux systems...)
So please handle this properly, don't crash.
thanks,
greg k-h
Quoted 4 lines · Greg Kroah-Hartman
WARN_ON()also crashes the system when panic-on-warn is enabled (as it is in a few billion Linux systems...)So please handle this properly, don't crash.
Good point, will send v2 with pr_warn() instead.
Thanks,
Gabriel