All of lore.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+2afd7e71155c7e241560@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [PATCH] usb: core: hub: fix memory leak in hub_port_connect
Date: Sat, 25 Apr 2026 01:58:43 -0700	[thread overview]
Message-ID: <69ec8243.a00a0220.7773.0013.GAE@google.com> (raw)
In-Reply-To: <69ec231a.a00a0220.7773.000c.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] usb: core: hub: fix memory leak in hub_port_connect
Author: souradiptodas6@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
master
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 24960ba9caa9..2924ce770066 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5405,6 +5405,7 @@ static void hub_port_connect(struct usb_hub *hub, int
port1, u16 portstatus,
                if (hcd->usb_phy && !hdev->parent)
                        usb_phy_notify_disconnect(hcd->usb_phy,
udev->speed);
                usb_disconnect(&port_dev->child);
+               udev = NULL;
        }

        /* We can forget about a "removed" device when there's a physical
@@ -5582,6 +5583,7 @@ static void hub_port_connect(struct usb_hub *hub, int
port1, u16 portstatus,
                        goto loop_disable;

                status = hub_power_remaining(hub);
+               udev = NULL;
                if (status)
                        dev_dbg(hub->intfdev, "%dmA power budget left\n",
status);

@@ -5624,6 +5626,8 @@ static void hub_port_connect(struct usb_hub *hub, int
port1, u16 portstatus,
                if (status != -ENOTCONN && status != -ENODEV)
                        hcd->driver->relinquish_port(hcd, port1);
        }
+       if (udev)
+               usb_put_dev(udev);
 }

 /* Handle physical or logical connection change events.

  parent reply	other threads:[~2026-04-25  8:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-25  2:12 [syzbot] [usb?] memory leak in hub_event (4) syzbot
2026-04-25  6:36 ` Forwarded: [PATCH] usb: core: fix memory leak in usb_new_device() error path syzbot
2026-04-25  7:52 ` Forwarded: [PATCH] ALSA: caiaq: fix usb_dev refcount leak on probe failure syzbot
2026-04-25  8:58 ` syzbot [this message]
2026-04-25  9:36 ` Forwarded: [PATCH] usb: core: hub: fix memory leak in hub_port_connect syzbot
2026-04-25 12:54 ` Forwarded: [PATCH] ALSA: caiaq: fix usb_dev refcount leak on probe failure syzbot
2026-04-25 14:43 ` syzbot
2026-04-26  2:33   ` Hillf Danton
2026-04-27 11:40 ` [syzbot] [usb?] memory leak in hub_event (4) Oliver Neukum
2026-04-27 12:37   ` syzbot
2026-04-27 14:19   ` Alan Stern
2026-04-28 11:33     ` Oliver Neukum
2026-04-28 15:12       ` Alan Stern
2026-04-29 10:42 ` [PATCH] usb: core: hcd: fix possible deadlock in rh control transfers Oliver Neukum
2026-04-29 19:04   ` Alan Stern
2026-04-29 19:13     ` Oliver Neukum
2026-04-29 19:18       ` Alan Stern
2026-04-29 10:45 ` [PATCH] sound: usb: caiaq: fix reference leak in probe error Oliver Neukum
2026-04-29 10:53   ` Takashi Iwai
2026-04-29 11:05     ` Oliver Neukum
2026-04-29 19:42   ` kernel test robot
2026-04-30  5:33   ` kernel test robot
2026-04-30 11:02   ` kernel test robot

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=69ec8243.a00a0220.7773.0013.GAE@google.com \
    --to=syzbot+2afd7e71155c7e241560@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.