]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
staging: most: dim2: replace BUG_ON() in try_start_dim_transfer()
authorGabriel Rondon <grondon@gmail.com>
Mon, 30 Mar 2026 18:22:51 +0000 (19:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Mar 2026 08:46:38 +0000 (10:46 +0200)
commitf3dc6732fd52b59bab522c5095290bca0d5f5555
tree7a0b9eff0834066f1547d8bee82067a32242d5b9
parentf019e98a2f35ec022872d8843ff9c9c9af90e6ec
staging: most: dim2: replace BUG_ON() in try_start_dim_transfer()

Replace BUG_ON() calls with graceful error handling.

For the null/uninitialized channel checks, return -EINVAL instead of
crashing the kernel. For the zero bus_address check, release the
spinlock and return -EFAULT.

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-2-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/dim2/dim2.c