From nobody Sun May 24 19:35:55 2026 Received: from sender-pp-o93.zoho.in (sender-pp-o93.zoho.in [103.117.158.93]) (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 A0B0E3128CF; Sat, 23 May 2026 06:22:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=103.117.158.93 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779517373; cv=pass; b=AleD9IXbEYtZpaoNNsq+oYG17bpvHrfG4ZeeZntcquY6ofnpFvKw8RYAWkJHwYlIn5SVc5EaoP/Dd6F7qsNMJy6qp0da6hFn0iFxDGmrfyNIWDTjCqGu/9EFoCdmgq+DSsBjNTsZkOWjsoHzIx0LwBsJwE4G5wUBrtr8eodkEZM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779517373; c=relaxed/simple; bh=DcGYQtSpJar3uKcn3JUGfnWWwccxu+srp6306Fr5jNk=; h=Date:From:To:Cc:Message-ID:Subject:MIME-Version:Content-Type; b=XBYj4iBcAa2xxr8/DlwXY2C3d5N9P2u3ozTspP9/Q4SG32EwbbWuzVUcX3tcRbdD8heZt8i8/ukd3Cpm0kwwj3F/bO69ze/vU3RIMDH4cMH6tOyv8rvJ2gb+0v1qvNHdmPVmMIwlZ8kH7Q0sHeehmQZRKm8bVsvgiyKcw6uTmTQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.in; spf=pass smtp.mailfrom=zohomail.in; dkim=pass (1024-bit key) header.d=zohomail.in header.i=linuxuser509@zohomail.in header.b=BqDN+IG7; arc=pass smtp.client-ip=103.117.158.93 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.in Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zohomail.in Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zohomail.in header.i=linuxuser509@zohomail.in header.b="BqDN+IG7" ARC-Seal: i=1; a=rsa-sha256; t=1779517336; cv=none; d=zohomail.in; s=zohoarc; b=cLmloSO7/9qaf/EIqs3nwo4r9PBVjT6cm0F9/5BNP4Wr0fQyIY58I8lhNFB7uld86kBe7l5NXGfQbgJfjXQKwigaXw5xJo6WfuEdKYRSL5PRSfFwSOXEEswTKj9XKpbIsGVCcSKjeTku8ykBK8kCqME7gtzjVjSEcj9j4cNnsPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.in; s=zohoarc; t=1779517336; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=hZxyXWmAPqKETQ9Pxse7c7KTUmJuXZ6q1hA+scXEGkw=; b=YaCN5S5VnxnsSytg1KXsfqKkocJz1HpdQOeePPuJyu97pqm7hCkTtriE0VhMkWt8MlhaHJrsrBjpEe5/p8VnoXtNTHX4qbPbLyRbbCbbfjuBZKHPLPJeKmqDEaj0/440zev+q37+KoW7Aiqg/DEFC3gpqL+au0yxwZXpow49mxc= ARC-Authentication-Results: i=1; mx.zohomail.in; dkim=pass header.i=zohomail.in; spf=pass smtp.mailfrom=linuxuser509@zohomail.in; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1779517336; s=zoho; d=zohomail.in; i=linuxuser509@zohomail.in; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=hZxyXWmAPqKETQ9Pxse7c7KTUmJuXZ6q1hA+scXEGkw=; b=BqDN+IG7zKiXQ4cUFfzhoIPlpKxh6QAhbw7W2nhzJUSekkPyfmNXGip/TyeLi7oA ZdqStJw38bcV9Ks7UwiaQ/VqY8ScL0NCpr8a2FW8AOY0BGqlZdmQZ10gHN2mEDpshW9 xbyUH6iW84cEZRD/m4qs9nLc1LvGz15JNcQmISps= Received: from mail.zoho.in by mx.zoho.in with SMTP id 1779517334906443.1321783571458; Sat, 23 May 2026 11:52:14 +0530 (IST) Received: from [106.219.3.73] by mail.zoho.in with HTTP;Sat, 23 May 2026 11:52:14 +0530 (IST) Date: Sat, 23 May 2026 11:52:14 +0530 From: Ashwin Gundarapu To: "anthonylnguyen" , "anthony.l.nguyen@intel.com" , "andrewnetdev" , "davem" , "edumazet" , "kuba" , "pabeni" Cc: "intel-wired-lan" , "netdev" , "linux-kernel" Message-ID: <19e537fa55c.56218d6244367.1765806925055659075@zohomail.in> Subject: [PATCH net-next] e1000e: fix memory leak of msix_entries on MSI-X failure Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Content-Type: text/plain; charset="utf-8" From: Ashwin Gundarapu Date: Sat, 23 May 2026 11:49:40 +0530 Subject: [PATCH] e1000e: fix memory leak of msix_entries on MSI-X failure When MSI-X initialization fails, the driver falls through to try MSI or legacy interrupts. However, the msix_entries array allocated earlier is not freed, causing a memory leak. Free it and set to NULL before falling through to the MSI fallback path. Found by code inspection. Signed-off-by: Ashwin Gundarapu --- drivers/net/ethernet/intel/e1000e/netdev.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ether= net/intel/e1000e/netdev.c index 7ce0cc8ab8f4..1526069d7fc1 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -2065,10 +2065,12 @@ void e1000e_set_interrupt_capability(struct e1000_a= dapter *adapter) a->num_vectors); if (err > 0) return; - } - /* MSI-X failed, so fall through and try MSI */ - e_err("Failed to initialize MSI-X interrupts. Falling back to MSI inte= rrupts.\n"); - e1000e_reset_interrupt_capability(adapter); + } + /* MSI-X failed, so fall through and try MSI */ + e_err("Failed to initialize MSI-X interrupts. Fal= ling back to MSI interrupts.\n"); + kfree(adapter->msix_entries); + adapter->msix_entries =3D NULL; + e1000e_reset_interrupt_capability(adapter); } adapter->int_mode =3D E1000E_INT_MODE_MSI; fallthrough; -- 2.43.0