From: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
To: <syzbot+7811bb68a317954a0347@syzkaller.appspotmail.com>
Cc: Nikita Zhandarovich <n.zhandarovich@fintech.ru>,
<syzkaller-bugs@googlegroups.com>, <linux-kernel@vger.kernel.org>
Subject: [syzbot] [comedi?] INFO: task hung in comedi_open
Date: Mon, 20 Oct 2025 20:59:10 +0300 [thread overview]
Message-ID: <20251020175911.150815-1-n.zhandarovich@fintech.ru> (raw)
In-Reply-To: <6890e4d5.050a0220.7f033.000d.GAE@google.com>
#syz test
---
drivers/comedi/drivers/multiq3.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/comedi/drivers/multiq3.c b/drivers/comedi/drivers/multiq3.c
index 467587b0b250..dc27651e0ace 100644
--- a/drivers/comedi/drivers/multiq3.c
+++ b/drivers/comedi/drivers/multiq3.c
@@ -67,6 +67,11 @@
#define MULTIQ3_TRSFRCNTR_OL 0x10 /* xfer CNTR to OL (x and y) */
#define MULTIQ3_EFLAG_RESET 0x06 /* reset E bit of flag reg */
+/*
+ * Semi-arbitrary limit on the number of optional encoder chips
+ */
+#define MULTIQ3_MAX_ENC_CHIPS 16
+
static void multiq3_set_ctrl(struct comedi_device *dev, unsigned int bits)
{
/*
@@ -314,6 +319,11 @@ static int multiq3_attach(struct comedi_device *dev,
/* Encoder (Counter) subdevice */
s = &dev->subdevices[4];
+
+ /* sanity check for number of optional encoders */
+ if (it->options[2] > MULTIQ3_MAX_ENC_CHIPS)
+ it->options[2] = MULTIQ3_MAX_ENC_CHIPS;
+
s->type = COMEDI_SUBD_COUNTER;
s->subdev_flags = SDF_READABLE | SDF_LSAMPL;
s->n_chan = it->options[2] * 2;
next prev parent reply other threads:[~2025-10-20 17:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-04 16:50 syzbot
2025-10-20 17:59 ` Nikita Zhandarovich [this message]
2025-10-20 23:53 ` syzbot
2025-10-21 12:24 ` Nikita Zhandarovich
2025-10-21 14:41 ` syzbot
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=20251020175911.150815-1-n.zhandarovich@fintech.ru \
--to=n.zhandarovich@fintech.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+7811bb68a317954a0347@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/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
all inboxes | Powered by JetHome®