[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250705081850.2552-1-hdanton@sina.com>
Date: Sat, 5 Jul 2025 16:18:49 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+6616bba359cec7a1def1@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [kernel?] WARNING in driver_unregister (2)
> Date: Fri, 04 Jul 2025 20:20:34 -0700
> syzbot found the following issue on:
>
> HEAD commit: c435a4f487e8 Merge tag 'riscv-for-linus-6.16-rc5' of git:/..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=138f8f70580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=5ba6cef8f153bfeb
> dashboard link: https://syzkaller.appspot.com/bug?extid=6616bba359cec7a1def1
> compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10b8febc580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=118f6c8c580000
#syz test
--- x/drivers/comedi/drivers.c
+++ y/drivers/comedi/drivers.c
@@ -994,10 +994,13 @@ int comedi_device_attach(struct comedi_d
dev->board_name = dev->board_ptr ? *(const char **)dev->board_ptr
: dev->driver->driver_name;
ret = driv->attach(dev, it);
- if (ret >= 0)
+ if (ret >= 0) {
ret = comedi_device_postconfig(dev);
- if (ret < 0) {
- comedi_device_detach(dev);
+ if (ret < 0) {
+ comedi_device_detach(dev);
+ module_put(driv->module);
+ }
+ } else {
module_put(driv->module);
}
/* On success, the driver module count has been incremented. */
--
Powered by blists - more mailing lists