From: Vasileios Almpanis <vasilisalmpanis@gmail.com>
To: syzbot+3e2e533aa1b2a75525e7@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: usb: gadget: pch_udc: don't call pch_udc_remove() from the probe error path
Date: Tue, 11 Aug 2026 17:09:17 +0200 [thread overview]
Message-ID: <20260811150918.1947280-1-vasilisalmpanis@gmail.com> (raw)
In-Reply-To: <6a7b1b45.9c11d2ce.289b96.0106.GAE@google.com>
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git d58772d8520c7ef247c4b95c9bd76d3a25da9ff5
diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c
index 0a6886428739..5704aff2b09b 100644
--- a/drivers/usb/gadget/udc/pch_udc.c
+++ b/drivers/usb/gadget/udc/pch_udc.c
@@ -2979,16 +2979,8 @@ static void pch_udc_shutdown(struct pci_dev *pdev)
pch_udc_set_disconnect(dev);
}
-static void pch_udc_remove(struct pci_dev *pdev)
+static void pch_udc_cleanup(struct pch_udc_dev *dev)
{
- struct pch_udc_dev *dev = pci_get_drvdata(pdev);
-
- usb_del_gadget_udc(&dev->gadget);
-
- /* gadget driver must not be registered */
- if (dev->driver)
- dev_err(&pdev->dev,
- "%s: gadget driver still bound!!!\n", __func__);
/* dma pool cleanup */
dma_pool_destroy(dev->data_requests);
@@ -3016,6 +3008,20 @@ static void pch_udc_remove(struct pci_dev *pdev)
pch_udc_exit(dev);
}
+static void pch_udc_remove(struct pci_dev *pdev)
+{
+ struct pch_udc_dev *dev = pci_get_drvdata(pdev);
+
+ usb_del_gadget_udc(&dev->gadget);
+
+ /* gadget driver must not be registered */
+ if (dev->driver)
+ dev_err(&pdev->dev,
+ "%s: gadget driver still bound!!!\n", __func__);
+
+ pch_udc_cleanup(dev);
+}
+
static int __maybe_unused pch_udc_suspend(struct device *d)
{
struct pch_udc_dev *dev = dev_get_drvdata(d);
@@ -3106,7 +3112,7 @@ static int pch_udc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
return 0;
finished:
- pch_udc_remove(pdev);
+ pch_udc_cleanup(dev);
return retval;
}
next prev parent reply other threads:[~2026-08-11 15:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 12:53 [syzbot] [usb?] WARNING: kobject bug in pch_udc_remove syzbot
2026-08-11 15:09 ` Vasileios Almpanis [this message]
2026-08-11 15:43 ` 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=20260811150918.1947280-1-vasilisalmpanis@gmail.com \
--to=vasilisalmpanis@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+3e2e533aa1b2a75525e7@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