Skip to content

Commit e922cb4

Browse files
gabrielrondongregkh
authored andcommitted
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>
1 parent adb44ba commit e922cb4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • drivers/staging/most/dim2

drivers/staging/most/dim2/dim2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,8 @@ static int enqueue(struct most_interface *most_iface, int ch_idx,
570570
struct hdm_channel *hdm_ch = dev->hch + ch_idx;
571571
unsigned long flags;
572572

573-
BUG_ON(ch_idx < 0 || ch_idx >= DMA_CHANNELS);
573+
if (ch_idx < 0 || ch_idx >= DMA_CHANNELS)
574+
return -EINVAL;
574575

575576
if (!hdm_ch->is_initialized)
576577
return -EPERM;

0 commit comments

Comments
 (0)