From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51A422F7461; Tue, 12 Aug 2025 17:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755020442; cv=none; b=opBy+rOMGb+FwpHOk3B4NF9WkzcSmz5bE8bnN6Jy2VlMLXtJUpHlKK4l/piB6dHYM3aGaCqKSqIpaFpiQ4C/9J6uPUwO42d1hzFanti2HNrJgBO+pyyrczVQ+J55vzW6jZU/tIFNFq9Pxry64aTP451rfhwcG9OsC1LFNVWMht4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755020442; c=relaxed/simple; bh=ZbYQfv6yb5M+a68P5dqBP5fPvxqfStf9YlqQCYuk9+Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kEn6MpC8QOq/WT8Z+qQRDoYgFLFqopi0T+sC+17kj3a6fl96lpPobIRdGxLdEtw6ea5ZThNEJe8NRq7pBq21qqLzmSKkB5sUbMcFkPIvkglkdXAiMHRJw3vo87oDUCo7Y7iYnZSFLPdblxA19UHJwFdelfkvvDQ867ql8LeWDKs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yw1sPZ/0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yw1sPZ/0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B350FC4CEF0; Tue, 12 Aug 2025 17:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755020442; bh=ZbYQfv6yb5M+a68P5dqBP5fPvxqfStf9YlqQCYuk9+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yw1sPZ/0aZggCM5krEYIbPa3A4Wfyh69KZ77rFE8p7+VPiLjdYigcZOtm4SWddN3H fbYkRsPxdkOgq8Qtg5OVZf8Wcwd/+Iy5Rl06K5VERccUyamLjRVNboAi6pj0+y17Gm 4QvqE0kFUZ8VLOBfZ3iMZmt2GhTQpbj2eZs1oBM4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lucas De Marchi , Sasha Levin Subject: [PATCH 6.1 082/253] usb: early: xhci-dbc: Fix early_ioremap leak Date: Tue, 12 Aug 2025 19:27:50 +0200 Message-ID: <20250812172952.233377103@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250812172948.675299901@linuxfoundation.org> References: <20250812172948.675299901@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lucas De Marchi [ Upstream commit 2b7eec2ec3015f52fc74cf45d0408925e984ecd1 ] 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 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 Signed-off-by: Sasha Levin --- drivers/usb/early/xhci-dbc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c index 7ef0a4b39762..a4e1390ed4fd 100644 --- a/drivers/usb/early/xhci-dbc.c +++ b/drivers/usb/early/xhci-dbc.c @@ -682,6 +682,10 @@ int __init early_xdbc_setup_hardware(void) xdbc.table_base = NULL; xdbc.out_buf = NULL; + + early_iounmap(xdbc.xhci_base, xdbc.xhci_length); + xdbc.xhci_base = NULL; + xdbc.xhci_length = 0; } return ret; -- 2.39.5