* [syzbot] [kernel?] WARNING: kobject bug in goku_remove
@ 2026-08-13 20:45 syzbot
2026-08-26 2:11 ` Forwarded: " syzbot
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: syzbot @ 2026-08-13 20:45 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 3aa1dcaa4f6f Revert "wifi: mt76: Disable napi when removin..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11e09c79580000
kernel config: https://syzkaller.appspot.com/x/.config?x=c44651ea7dd2f307
dashboard link: https://syzkaller.appspot.com/bug?extid=06ec7624018233e17113
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=160e4ac6580000
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+06ec7624018233e17113@syzkaller.appspotmail.com
usb usb3: USB disconnect, device number 1
uhci_hcd 0000:00:1d.1: USB bus 3 deregistered
------------[ cut here ]------------
kobject: '(null)' (ffff8880281480d8): is not initialized, yet kobject_put() is being called.
WARNING: lib/kobject.c:734 at kobject_put+0x252/0x640 lib/kobject.c:734, CPU#2: syz-executor405/6027
Modules linked in:
CPU: 2 UID: 0 PID: 6027 Comm: syz-executor405 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:kobject_put+0x258/0x640 lib/kobject.c:734
Code: 59 f6 48 89 da 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 5e 03 00 00 48 8d 3d 9e 2d 83 05 48 8b 33 48 89 da <67> 48 0f b9 3a e9 0b fe ff ff e8 b9 88 59 f6 be 03 00 00 00 4c 89
RSP: 0018:ffffc90003437728 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: ffff8880281480d8 RCX: ffffffff8bb0e8c4
RDX: ffff8880281480d8 RSI: 0000000000000000 RDI: ffffffff91341850
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff888028148114
R13: dffffc0000000000 R14: ffff888028148834 R15: 0000000000000000
FS: 0000555585cdf400(0000) GS:ffff8880d5fe9000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffe6f14cda8 CR3: 0000000055370000 CR4: 0000000000352ef0
Call Trace:
<TASK>
put_device+0x1f/0x30 drivers/base/core.c:3880
goku_remove+0x47/0x470 drivers/usb/gadget/udc/goku_udc.c:1717
goku_probe+0x2f6/0x3c0 drivers/usb/gadget/udc/goku_udc.c:1830
local_pci_probe+0xdd/0x1b0 drivers/pci/pci-driver.c:332
pci_call_probe+0x176/0x800 drivers/pci/pci-driver.c:394
__pci_device_probe drivers/pci/pci-driver.c:455 [inline]
pci_device_probe+0x1cd/0x370 drivers/pci/pci-driver.c:489
call_driver_probe drivers/base/dd.c:628 [inline]
really_probe+0x241/0xa60 drivers/base/dd.c:706
__driver_probe_device+0x20e/0x450 drivers/base/dd.c:868
driver_probe_device+0x4a/0x140 drivers/base/dd.c:898
__driver_attach+0x21f/0x5b0 drivers/base/dd.c:1292
bus_for_each_dev+0x13e/0x1d0 drivers/base/bus.c:383
pci_add_dynid+0x2b5/0x370 drivers/pci/pci-driver.c:77
new_id_store+0x2a9/0x5b0 drivers/pci/pci-driver.c:249
drv_attr_store+0x74/0xb0 drivers/base/bus.c:125
sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145
kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x6ac/0x1050 fs/read_write.c:687
ksys_write+0x12a/0x250 fs/read_write.c:739
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f370300ce37
Code: 48 89 fa 4c 89 df e8 98 1d 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007fff6fddcbc0 EFLAGS: 00000202 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000555585cdf400 RCX: 00007f370300ce37
RDX: 000000000000000d RSI: 00007fff6fddcc80 RDI: 0000000000000003
RBP: 00007fff6fddd400 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000003
R13: 00007fff6fddcf20 R14: 00007fff6fddcd00 R15: 000000000000000a
</TASK>
----------------
Code disassembly (best guess):
0: 59 pop %rcx
1: f6 48 89 da testb $0xda,-0x77(%rax)
5: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
c: fc ff df
f: 48 c1 ea 03 shr $0x3,%rdx
13: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
17: 0f 85 5e 03 00 00 jne 0x37b
1d: 48 8d 3d 9e 2d 83 05 lea 0x5832d9e(%rip),%rdi # 0x5832dc2
24: 48 8b 33 mov (%rbx),%rsi
27: 48 89 da mov %rbx,%rdx
* 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction
2f: e9 0b fe ff ff jmp 0xfffffe3f
34: e8 b9 88 59 f6 call 0xf65988f2
39: be 03 00 00 00 mov $0x3,%esi
3e: 4c rex.WR
3f: 89 .byte 0x89
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 4+ messages in thread
* Forwarded: Re: [syzbot] [kernel?] WARNING: kobject bug in goku_remove
2026-08-13 20:45 [syzbot] [kernel?] WARNING: kobject bug in goku_remove syzbot
@ 2026-08-26 2:11 ` syzbot
2026-08-26 3:10 ` syzbot
2026-08-26 8:03 ` syzbot
2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2026-08-26 2:11 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: [syzbot] [kernel?] WARNING: kobject bug in goku_remove
Author: chenglingfei@foxmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 3aa1dcaa4f6f5ae08936491e08bd456f331f2d40
diff --git a/drivers/usb/gadget/udc/goku_udc.c b/drivers/usb/gadget/udc/goku_udc.c
index ac2a984c2f87..827f698bf222 100644
--- a/drivers/usb/gadget/udc/goku_udc.c
+++ b/drivers/usb/gadget/udc/goku_udc.c
@@ -20,6 +20,7 @@
// #define VERBOSE /* extra debug messages (success too) */
// #define USB_TRACE /* packet-level success messages */
+#include <linux/container_of.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -1701,7 +1702,7 @@ static irqreturn_t goku_irq(int irq, void *_dev)
static void gadget_release(struct device *_dev)
{
- struct goku_udc *dev = dev_get_drvdata(_dev);
+ struct goku_udc *dev = container_of(_dev, struct goku_udc, gadget.dev);
kfree(dev);
}
@@ -1714,12 +1715,14 @@ static void goku_remove(struct pci_dev *pdev)
DBG(dev, "%s\n", __func__);
- usb_del_gadget_udc(&dev->gadget);
+ if (dev->added)
+ usb_del_gadget(&dev->gadget);
BUG_ON(dev->driver);
#ifdef CONFIG_USB_GADGET_DEBUG_FILES
- remove_proc_entry(proc_node_name, NULL);
+ if (dev->proc_created)
+ remove_proc_entry(proc_node_name, NULL);
#endif
if (dev->regs)
udc_reset(dev);
@@ -1736,6 +1739,8 @@ static void goku_remove(struct pci_dev *pdev)
dev->regs = NULL;
INFO(dev, "unbind\n");
+
+ usb_put_gadget(&dev->gadget);
}
/* wrap this driver around the specified pci device, but
@@ -1751,16 +1756,13 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (!pdev->irq) {
printk(KERN_ERR "Check PCI %s IRQ setup!\n", pci_name(pdev));
- retval = -ENODEV;
- goto err;
+ return -ENODEV;
}
/* alloc, and start init */
dev = kzalloc_obj(*dev);
- if (!dev) {
- retval = -ENOMEM;
- goto err;
- }
+ if (!dev)
+ return -ENOMEM;
pci_set_drvdata(pdev, dev);
spin_lock_init(&dev->lock);
@@ -1771,6 +1773,8 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
/* the "gadget" abstracts/virtualizes the controller */
dev->gadget.name = driver_name;
+ usb_initialize_gadget(&pdev->dev, &dev->gadget, gadget_release);
+
/* now all the pci goodies ... */
retval = pci_enable_device(pdev);
if (retval < 0) {
@@ -1815,21 +1819,19 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
#ifdef CONFIG_USB_GADGET_DEBUG_FILES
- proc_create_single_data(proc_node_name, 0, NULL, udc_proc_read, dev);
+ dev->proc_created = !!proc_create_single_data(proc_node_name, 0, NULL,
+ udc_proc_read, dev);
#endif
- retval = usb_add_gadget_udc_release(&pdev->dev, &dev->gadget,
- gadget_release);
+ retval = usb_add_gadget(&dev->gadget);
if (retval)
goto err;
+ dev->added = 1;
return 0;
err:
- if (dev)
- goku_remove (pdev);
- /* gadget_release is not registered yet, kfree explicitly */
- kfree(dev);
+ goku_remove(pdev);
return retval;
}
diff --git a/drivers/usb/gadget/udc/goku_udc.h b/drivers/usb/gadget/udc/goku_udc.h
index 70023d401079..f815f38304f6 100644
--- a/drivers/usb/gadget/udc/goku_udc.h
+++ b/drivers/usb/gadget/udc/goku_udc.h
@@ -247,7 +247,9 @@ struct goku_udc {
got_region:1,
req_config:1,
configured:1,
- enabled:1;
+ enabled:1,
+ added:1,
+ proc_created:1;
/* pci state used to access those endpoints */
struct pci_dev *pdev;
@@ -286,4 +288,3 @@ struct goku_udc {
xprintk(dev , KERN_WARNING , fmt , ## args)
#define INFO(dev,fmt,args...) \
xprintk(dev , KERN_INFO , fmt , ## args)
-
^ permalink raw reply [flat|nested] 4+ messages in thread
* Forwarded: Re: [syzbot] [kernel?] WARNING: kobject bug in goku_remove
2026-08-13 20:45 [syzbot] [kernel?] WARNING: kobject bug in goku_remove syzbot
2026-08-26 2:11 ` Forwarded: " syzbot
@ 2026-08-26 3:10 ` syzbot
2026-08-26 8:03 ` syzbot
2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2026-08-26 3:10 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: [syzbot] [kernel?] WARNING: kobject bug in goku_remove
Author: chenglingfei@foxmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 3aa1dcaa4f6f5ae08936491e08bd456f331f2d40
diff --git a/drivers/usb/gadget/udc/goku_udc.c b/drivers/usb/gadget/udc/goku_udc.c
index ac2a984c2f87..7af6da63e83b 100644
--- a/drivers/usb/gadget/udc/goku_udc.c
+++ b/drivers/usb/gadget/udc/goku_udc.c
@@ -20,6 +20,7 @@
// #define VERBOSE /* extra debug messages (success too) */
// #define USB_TRACE /* packet-level success messages */
+#include <linux/container_of.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -1052,8 +1053,6 @@ static inline const char *dmastr(void)
#ifdef CONFIG_USB_GADGET_DEBUG_FILES
-static const char proc_node_name [] = "driver/udc";
-
#define FOURBITS "%s%s%s%s"
#define EIGHTBITS FOURBITS FOURBITS
@@ -1701,7 +1700,7 @@ static irqreturn_t goku_irq(int irq, void *_dev)
static void gadget_release(struct device *_dev)
{
- struct goku_udc *dev = dev_get_drvdata(_dev);
+ struct goku_udc *dev = container_of(_dev, struct goku_udc, gadget.dev);
kfree(dev);
}
@@ -1714,12 +1713,13 @@ static void goku_remove(struct pci_dev *pdev)
DBG(dev, "%s\n", __func__);
- usb_del_gadget_udc(&dev->gadget);
+ if (dev->added)
+ usb_del_gadget(&dev->gadget);
BUG_ON(dev->driver);
#ifdef CONFIG_USB_GADGET_DEBUG_FILES
- remove_proc_entry(proc_node_name, NULL);
+ proc_remove(dev->proc_entry);
#endif
if (dev->regs)
udc_reset(dev);
@@ -1736,6 +1736,8 @@ static void goku_remove(struct pci_dev *pdev)
dev->regs = NULL;
INFO(dev, "unbind\n");
+
+ usb_put_gadget(&dev->gadget);
}
/* wrap this driver around the specified pci device, but
@@ -1748,19 +1750,19 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
unsigned long resource, len;
void __iomem *base = NULL;
int retval;
+#ifdef CONFIG_USB_GADGET_DEBUG_FILES
+ char proc_node_name[64];
+#endif
if (!pdev->irq) {
printk(KERN_ERR "Check PCI %s IRQ setup!\n", pci_name(pdev));
- retval = -ENODEV;
- goto err;
+ return -ENODEV;
}
/* alloc, and start init */
dev = kzalloc_obj(*dev);
- if (!dev) {
- retval = -ENOMEM;
- goto err;
- }
+ if (!dev)
+ return -ENOMEM;
pci_set_drvdata(pdev, dev);
spin_lock_init(&dev->lock);
@@ -1771,6 +1773,8 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
/* the "gadget" abstracts/virtualizes the controller */
dev->gadget.name = driver_name;
+ usb_initialize_gadget(&pdev->dev, &dev->gadget, gadget_release);
+
/* now all the pci goodies ... */
retval = pci_enable_device(pdev);
if (retval < 0) {
@@ -1815,21 +1819,21 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
#ifdef CONFIG_USB_GADGET_DEBUG_FILES
- proc_create_single_data(proc_node_name, 0, NULL, udc_proc_read, dev);
+ snprintf(proc_node_name, sizeof(proc_node_name), "driver/goku_udc-%s",
+ pci_name(pdev));
+ dev->proc_entry = proc_create_single_data(proc_node_name, 0, NULL,
+ udc_proc_read, dev);
#endif
- retval = usb_add_gadget_udc_release(&pdev->dev, &dev->gadget,
- gadget_release);
+ retval = usb_add_gadget(&dev->gadget);
if (retval)
goto err;
+ dev->added = 1;
return 0;
err:
- if (dev)
- goku_remove (pdev);
- /* gadget_release is not registered yet, kfree explicitly */
- kfree(dev);
+ goku_remove(pdev);
return retval;
}
diff --git a/drivers/usb/gadget/udc/goku_udc.h b/drivers/usb/gadget/udc/goku_udc.h
index 70023d401079..0ca2d49d25ba 100644
--- a/drivers/usb/gadget/udc/goku_udc.h
+++ b/drivers/usb/gadget/udc/goku_udc.h
@@ -247,7 +247,12 @@ struct goku_udc {
got_region:1,
req_config:1,
configured:1,
- enabled:1;
+ enabled:1,
+ added:1;
+
+#ifdef CONFIG_USB_GADGET_DEBUG_FILES
+ struct proc_dir_entry *proc_entry;
+#endif
/* pci state used to access those endpoints */
struct pci_dev *pdev;
@@ -286,4 +291,3 @@ struct goku_udc {
xprintk(dev , KERN_WARNING , fmt , ## args)
#define INFO(dev,fmt,args...) \
xprintk(dev , KERN_INFO , fmt , ## args)
-
^ permalink raw reply [flat|nested] 4+ messages in thread
* Forwarded: Re: [syzbot] [kernel?] WARNING: kobject bug in goku_remove
2026-08-13 20:45 [syzbot] [kernel?] WARNING: kobject bug in goku_remove syzbot
2026-08-26 2:11 ` Forwarded: " syzbot
2026-08-26 3:10 ` syzbot
@ 2026-08-26 8:03 ` syzbot
2 siblings, 0 replies; 4+ messages in thread
From: syzbot @ 2026-08-26 8:03 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: [syzbot] [kernel?] WARNING: kobject bug in goku_remove
Author: chenglingfei@foxmail.com
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 3aa1dcaa4f6f5ae08936491e08bd456f331f2d40
diff --git a/drivers/usb/gadget/udc/goku_udc.c b/drivers/usb/gadget/udc/goku_udc.c
index ac2a984c2f87..e6941b9d0f6b 100644
--- a/drivers/usb/gadget/udc/goku_udc.c
+++ b/drivers/usb/gadget/udc/goku_udc.c
@@ -20,6 +20,8 @@
// #define VERBOSE /* extra debug messages (success too) */
// #define USB_TRACE /* packet-level success messages */
+#include <linux/container_of.h>
+#include <linux/debugfs.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -30,9 +32,9 @@
#include <linux/timer.h>
#include <linux/list.h>
#include <linux/interrupt.h>
-#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/device.h>
+#include <linux/usb.h>
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <linux/prefetch.h>
@@ -1050,9 +1052,7 @@ static inline const char *dmastr(void)
return "(dma IN)";
}
-#ifdef CONFIG_USB_GADGET_DEBUG_FILES
-
-static const char proc_node_name [] = "driver/udc";
+#ifdef CONFIG_USB_GADGET_DEBUG_FS
#define FOURBITS "%s%s%s%s"
#define EIGHTBITS FOURBITS FOURBITS
@@ -1134,7 +1134,7 @@ static const char *udc_ep_status(u32 status)
return "?";
}
-static int udc_proc_read(struct seq_file *m, void *v)
+static int goku_debugfs_show(struct seq_file *m, void *v)
{
struct goku_udc *dev = m->private;
struct goku_udc_regs __iomem *regs = dev->regs;
@@ -1246,7 +1246,33 @@ static int udc_proc_read(struct seq_file *m, void *v)
local_irq_restore(flags);
return 0;
}
-#endif /* CONFIG_USB_GADGET_DEBUG_FILES */
+DEFINE_SHOW_ATTRIBUTE(goku_debugfs);
+
+static void goku_debugfs_create(struct goku_udc *dev)
+{
+ dev->debugfs_root =
+ debugfs_create_dir(dev_name(&dev->pdev->dev), usb_debug_root);
+ debugfs_create_file("goku_udc_state", 0400, dev->debugfs_root, dev,
+ &goku_debugfs_fops);
+}
+
+static void goku_debugfs_remove(struct goku_udc *dev)
+{
+ debugfs_remove_recursive(dev->debugfs_root);
+ dev->debugfs_root = NULL;
+}
+
+#else
+
+static inline void goku_debugfs_create(struct goku_udc *dev)
+{
+}
+
+static inline void goku_debugfs_remove(struct goku_udc *dev)
+{
+}
+
+#endif /* CONFIG_USB_GADGET_DEBUG_FS */
/*-------------------------------------------------------------------------*/
@@ -1701,7 +1727,7 @@ static irqreturn_t goku_irq(int irq, void *_dev)
static void gadget_release(struct device *_dev)
{
- struct goku_udc *dev = dev_get_drvdata(_dev);
+ struct goku_udc *dev = container_of(_dev, struct goku_udc, gadget.dev);
kfree(dev);
}
@@ -1714,13 +1740,12 @@ static void goku_remove(struct pci_dev *pdev)
DBG(dev, "%s\n", __func__);
- usb_del_gadget_udc(&dev->gadget);
+ if (dev->added)
+ usb_del_gadget(&dev->gadget);
BUG_ON(dev->driver);
-#ifdef CONFIG_USB_GADGET_DEBUG_FILES
- remove_proc_entry(proc_node_name, NULL);
-#endif
+ goku_debugfs_remove(dev);
if (dev->regs)
udc_reset(dev);
if (dev->got_irq)
@@ -1736,6 +1761,8 @@ static void goku_remove(struct pci_dev *pdev)
dev->regs = NULL;
INFO(dev, "unbind\n");
+
+ usb_put_gadget(&dev->gadget);
}
/* wrap this driver around the specified pci device, but
@@ -1751,16 +1778,13 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (!pdev->irq) {
printk(KERN_ERR "Check PCI %s IRQ setup!\n", pci_name(pdev));
- retval = -ENODEV;
- goto err;
+ return -ENODEV;
}
/* alloc, and start init */
dev = kzalloc_obj(*dev);
- if (!dev) {
- retval = -ENOMEM;
- goto err;
- }
+ if (!dev)
+ return -ENOMEM;
pci_set_drvdata(pdev, dev);
spin_lock_init(&dev->lock);
@@ -1771,6 +1795,8 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
/* the "gadget" abstracts/virtualizes the controller */
dev->gadget.name = driver_name;
+ usb_initialize_gadget(&pdev->dev, &dev->gadget, gadget_release);
+
/* now all the pci goodies ... */
retval = pci_enable_device(pdev);
if (retval < 0) {
@@ -1814,22 +1840,16 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
pci_set_master(pdev);
-#ifdef CONFIG_USB_GADGET_DEBUG_FILES
- proc_create_single_data(proc_node_name, 0, NULL, udc_proc_read, dev);
-#endif
-
- retval = usb_add_gadget_udc_release(&pdev->dev, &dev->gadget,
- gadget_release);
+ retval = usb_add_gadget(&dev->gadget);
if (retval)
goto err;
+ dev->added = 1;
+ goku_debugfs_create(dev);
return 0;
err:
- if (dev)
- goku_remove (pdev);
- /* gadget_release is not registered yet, kfree explicitly */
- kfree(dev);
+ goku_remove(pdev);
return retval;
}
diff --git a/drivers/usb/gadget/udc/goku_udc.h b/drivers/usb/gadget/udc/goku_udc.h
index 70023d401079..ed39e7080536 100644
--- a/drivers/usb/gadget/udc/goku_udc.h
+++ b/drivers/usb/gadget/udc/goku_udc.h
@@ -247,7 +247,12 @@ struct goku_udc {
got_region:1,
req_config:1,
configured:1,
- enabled:1;
+ enabled:1,
+ added:1;
+
+#ifdef CONFIG_USB_GADGET_DEBUG_FS
+ struct dentry *debugfs_root;
+#endif
/* pci state used to access those endpoints */
struct pci_dev *pdev;
@@ -286,4 +291,3 @@ struct goku_udc {
xprintk(dev , KERN_WARNING , fmt , ## args)
#define INFO(dev,fmt,args...) \
xprintk(dev , KERN_INFO , fmt , ## args)
-
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-26 8:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-13 20:45 [syzbot] [kernel?] WARNING: kobject bug in goku_remove syzbot
2026-08-26 2:11 ` Forwarded: " syzbot
2026-08-26 3:10 ` syzbot
2026-08-26 8:03 ` syzbot
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®