Commit e922cb40 authored by Gabriel Rondon's avatar Gabriel Rondon Committed by Greg Kroah-Hartman
Browse files

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: default avatarGabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260330182255.75241-5-grondon@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent adb44bab
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;