]> www.infradead.org Git - users/jedix/linux-maple.git/commit
usb: early: xhci-dbc: Fix early_ioremap leak
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 27 Jun 2025 21:47:47 +0000 (14:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jul 2025 09:04:46 +0000 (11:04 +0200)
commit2b7eec2ec3015f52fc74cf45d0408925e984ecd1
treef840bfebb2c4f142c5724ce75654eef7b3158c14
parent0c43c19bf7a6cf2883b4a7ff08171be4af8ef814
usb: early: xhci-dbc: Fix early_ioremap leak

Using the kernel param earlyprintk=xdbc,keep without proper hardware
setup leads to this:

[ ] xhci_dbc:early_xdbc_parse_parameter: dbgp_num: 0
...
[ ] xhci_dbc:early_xdbc_setup_hardware: failed to setup the connection to host
...
[ ] calling  kmemleak_late_init+0x0/0xa0 @ 1
[ ] kmemleak: Kernel memory leak detector initialized (mem pool available: 14919)
[ ] kmemleak: Automatic memory scanning thread started
[ ] initcall kmemleak_late_init+0x0/0xa0 returned 0 after 417 usecs
[ ] calling  check_early_ioremap_leak+0x0/0x70 @ 1
[ ] ------------[ cut here ]------------
[ ] Debug warning: early ioremap leak of 1 areas detected.
    please boot with early_ioremap_debug and report the dmesg.
[ ] WARNING: CPU: 11 PID: 1 at mm/early_ioremap.c:90 check_early_ioremap_leak+0x4e/0x70

When early_xdbc_setup_hardware() fails, make sure to call
early_iounmap() since xdbc_init() won't handle it.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Fixes: aeb9dd1de98c ("usb/early: Add driver for xhci debug capability")
Link: https://lore.kernel.org/r/20250627-xdbc-v1-1-43cc8c317b1b@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/early/xhci-dbc.c