staging: most: dim2: replace BUG_ON() in configure_channel()

Replace BUG_ON() range check on ch_idx with a return of -EINVAL.

BUG_ON() is deprecated as it crashes the entire kernel on assertion
failure (see Documentation/process/deprecated.rst).

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260330182255.75241-4-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Gabriel Rondon 2026-03-30 19:22:53 +01:00 committed by Greg Kroah-Hartman
parent 2466b3dd40
commit adb44bab0a

View File

@ -457,7 +457,8 @@ static int configure_channel(struct most_interface *most_iface, int ch_idx,
int const ch_addr = ch_idx * 2 + 2;
struct hdm_channel *const hdm_ch = dev->hch + ch_idx;
BUG_ON(ch_idx < 0 || ch_idx >= DMA_CHANNELS);
if (ch_idx < 0 || ch_idx >= DMA_CHANNELS)
return -EINVAL;
if (hdm_ch->is_initialized)
return -EPERM;