From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 9B71D476CC8; Fri, 7 Aug 2026 15:41:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786117305; cv=none; b=PP0Jql0wyqnIbE5wpR1QEOovijb12oOwhtsXBYapUd3TM/895HE/HB2VNSbgEzSzPI+GRXUdA6TgH/J51qcar9pk3UMZJcBS+HZeosZQ9kFyNLt1vq7Xhu0pc93NGbRfpTW4WApA5jLTcyE/KgVVYdCB94bcvDccW62lgS/rhYI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786117305; c=relaxed/simple; bh=LfG+8KPOtcoxLMK/yryFujYXUL0j4mO1dtPHZtgQK3A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oy32k/6ih46zkF+yjsfuhDGMLWOgkuEacsxdbPX+ZzIvfNeTfCj0LVz6K7I7vRZowjdwEj/VXvjPVLXOMSCcmKdb0F/9veH8+mIlrncuQ6rU//tbULCxpmAECCuChPzHGCSq+ci3k4PPuP+0G4Bjskg8vnXU9TVjBHoq/fKDpyI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nHmXlQt+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nHmXlQt+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F21D41F000E9; Fri, 7 Aug 2026 15:41:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786117304; bh=IsMs+Odc+tVAjrxNot6NYKyQrFTwCCKObp5c+tnV4js=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nHmXlQt+N9H+RFVhiUVI/HzS49idCoUQ78SrxhtJEr92dYN7tWhKV4YJDk/cVrbrs OnJWNxd2GMZJGs1kV2pB8Jqi2WwFta1sKAeVq58FA+iGpEU4P1qknwronoDP9eBLte Z+X4K+Fcyfb+Bn4qSAG5EakLc1D0PNV2jVWBCdPc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zilin Guan , Dawei Feng , Dima Ruinskiy , Tony Nguyen Subject: [PATCH 7.1 273/438] e1000: fix memory leak in e1000_probe() Date: Fri, 7 Aug 2026 16:37:49 +0200 Message-ID: <20260807143433.803584732@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260807143428.008222056@linuxfoundation.org> References: <20260807143428.008222056@linuxfoundation.org> User-Agent: quilt/0.69 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 7.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dawei Feng commit 816419dfea5c88126f35eb7a1b429a1bf546665e upstream. In the e1000_probe() path, e1000_sw_init() allocates adapter->tx_ring and adapter->rx_ring. If the subsequent CE4100-specific MDIO BAR mapping fails, the error handling jumps past the ring cleanup code, leaking both allocations. Fix this leak by moving the err_mdio_ioremap label above the ring deallocation logic. This guarantees the proper release of these resources and prevents the memory leak. The bug was first flagged by an experimental analysis tool we are developing for kernel memory-management bugs while analyzing v6.13-rc1. The tool is still under development and is not yet publicly available. Manual inspection confirms that the bug is still present in v7.1-rc6. An x86_64 allyesconfig build showed no new warnings. As we do not have a CE4100 reference platform to test with, no runtime testing was able to be performed. Fixes: 5377a4160bb65 ("e1000: Add support for the CE4100 reference platform") Cc: stable@vger.kernel.org Signed-off-by: Zilin Guan Signed-off-by: Dawei Feng Reviewed-by: Dima Ruinskiy Signed-off-by: Tony Nguyen Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c @@ -1222,11 +1222,11 @@ err_eeprom: if (hw->flash_address) iounmap(hw->flash_address); +err_mdio_ioremap: kfree(adapter->tx_ring); kfree(adapter->rx_ring); err_dma: err_sw_init: -err_mdio_ioremap: iounmap(hw->ce4100_gbe_mdio_base_virt); iounmap(hw->hw_addr); err_ioremap: