summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorGabriel Rondon <grondon@gmail.com>2026-03-30 19:22:54 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-03-31 10:46:39 +0200
commite922cb40026c7ab788d1955f8977e354167f6496 (patch)
tree219f661a316b634bfdc62ed27543420acb635993 /drivers/staging
parentadb44bab0ac96391dc9d0e4b3604b65e558f23ec (diff)
staging: most: dim2: replace BUG_ON() in enqueue()
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-5-grondon@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/most/dim2/dim2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c
index 0b80f313a266..23230a32c2cb 100644
--- a/drivers/staging/most/dim2/dim2.c
+++ b/drivers/staging/most/dim2/dim2.c
@@ -570,7 +570,8 @@ static int enqueue(struct most_interface *most_iface, int ch_idx,
struct hdm_channel *hdm_ch = dev->hch + ch_idx;
unsigned long flags;
- 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;