From: Nguyen Duc Thinh <ducthinh100812@gmail.com>
To: Luka Gejak <luka.gejak@linux.dev>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, Gabriel Rondon <grondon@gmail.com>
Subject: [PATCH v3 1/2] staging: most: dim2: replace BUG_ON() in poison_channel()
Date: Sun, 12 Apr 2026 20:00:11 +0700 [thread overview]
Message-ID: <20260412130012.5832-2-ducthinh100812@gmail.com> (raw)
In-Reply-To: <20260412130012.5832-1-ducthinh100812@gmail.com>
From: Gabriel Rondon <grondon@gmail.com>
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>
---
drivers/staging/most/dim2/dim2.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c
index 23230a32c2cb..7953d4626752 100644
--- a/drivers/staging/most/dim2/dim2.c
+++ b/drivers/staging/most/dim2/dim2.c
@@ -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;
--
2.47.3
next prev parent reply other threads:[~2026-04-12 13:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-12 13:00 [PATCH v3 1/2] staging: most: dim2: replace BUG_ON() in enqueue() Nguyen Duc Thinh
2026-04-12 13:00 ` Nguyen Duc Thinh [this message]
2026-04-12 13:00 ` [PATCH v3 2/2] staging: rtl8723bs: rename dot11AuthAlgrthm to fix CamelCase Nguyen Duc Thinh
2026-04-12 14:37 ` David Laight
2026-04-12 18:52 ` [PATCH v3 1/2] staging: most: dim2: replace BUG_ON() in enqueue() Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260412130012.5832-2-ducthinh100812@gmail.com \
--to=ducthinh100812@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=grondon@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=luka.gejak@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox