mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
staging: most: dim2: replace BUG_ON() in poison_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-6-grondon@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e922cb4002
commit
e87946666e
@@ -647,7 +647,8 @@ static int poison_channel(struct most_interface *most_iface, int ch_idx)
|
||||
u8 hal_ret;
|
||||
int ret = 0;
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user