Skip to content

Commit adb44ba

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

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
@@ -457,7 +457,8 @@ static int configure_channel(struct most_interface *most_iface, int ch_idx,
457457
int const ch_addr = ch_idx * 2 + 2;
458458
struct hdm_channel *const hdm_ch = dev->hch + ch_idx;
459459

460-
BUG_ON(ch_idx < 0 || ch_idx >= DMA_CHANNELS);
460+
if (ch_idx < 0 || ch_idx >= DMA_CHANNELS)
461+
return -EINVAL;
461462

462463
if (hdm_ch->is_initialized)
463464
return -EPERM;

0 commit comments

Comments
 (0)