Re: [PATCH] staging: most: dim2: replace BUG_ON() with graceful error handling
From: Greg KH
Date: Mon Mar 30 2026 - 11:57:54 EST
On Thu, Mar 19, 2026 at 11:54:08AM +0000, Gabriel Rondon wrote:
> BUG_ON() is deprecated as it crashes the entire kernel on assertion
> failure (see Documentation/process/deprecated.rst). Replace all
> BUG_ON() calls in dim2.c with proper error handling that returns
> appropriate error codes instead of panicking.
>
> In try_start_dim_transfer(), replace the BUG_ON for null/uninitialized
> channel with an early return of -EINVAL, and replace the BUG_ON for
> zero bus_address with an error return that properly releases the
> spinlock first.
>
> In service_done_flag(), replace BUG_ON with an early return since the
> function returns void.
>
> In configure_channel(), enqueue(), and poison_channel(), replace BUG_ON
> range checks on ch_idx with returns of -EINVAL.
This should be one patch per function, right?
thanks,
greg k-h