From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (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 85CCC390204 for ; Mon, 13 Jul 2026 09:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783934353; cv=none; b=KCuOxv51bJT1Nb9dL0ZCaQqAwS4qPH6Fffj770fGZHHGhqmkrl0hO6UswFZepYqsg8weemYF7NVOaOkbkcQQCcWFwDASdEdPNSfCjlKJguEKSGwOGFxTPd9ZdAD+pPX+xJ5N6FPlBtQ7X+zPmvLpGGAjXSC1dbWv7G8TVPCYge8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783934353; c=relaxed/simple; bh=MP/mraMYPzMCsg/a5Ny4sp39c4ZUBsePrVPYbxMVRQ8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=c6gXOuvwaDaJahN9gMYUrLzwT/FUVv8oRNnk7GICz5JpW4316alDjKp3Af29VKxwW9JorqfXxOQutkzgTCbBW47R+MINHMINU+hfpFTqk55fvcLlnCA2gjG1Ch5ZFOxmWI3cgucNH8BfIPsYeAN0jaRKZeiW6EiHXECr0CBvD1s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=sSmh4Y7K; arc=none smtp.client-ip=95.215.58.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="sSmh4Y7K" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1783934349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TfurWKfkQ/L/AF2s3gX9ZPsRLKGrIjeB4Q2OBHdEoYY=; b=sSmh4Y7KlODc31q/R4GP//R7098tdBA4zhKubhcKGSgahsYRp/CmH/eAFnu+bWTGl2IaN0 GHM4dMHq2EwJ2S93kcAdinpQ9ZYm6QPA1zjpRX44VjGicthGQllnhHjMIqf6FakRrgakG3 CkfvLDygRP5Gax4vAjVlg1kkR+/tnG4= From: Chenguang Zhao To: jiawenwu@trustnetic.com, mengyuanlou@net-swift.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: chenguang.zhao@linux.dev, netdev@vger.kernel.org, Chenguang Zhao Subject: [PATCH net] net: txgbe: fix FDIR filter leak on remove Date: Mon, 13 Jul 2026 17:19:11 +0800 Message-Id: <20260713091911.1614795-1-chenguang.zhao@linux.dev> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT From: Chenguang Zhao Perfect FDIR filters can be added while the interface is down and are kept on the software list for later restore. unregister_netdev() only calls ndo_stop when the device is up, so txgbe_fdir_filter_exit() in txgbe_close() is skipped in that case and the filters are leaked on driver remove. Free the filter list from txgbe_remove() as well. Fixes: 4bdb441105dc ("net: txgbe: support Flow Director perfect filters") Signed-off-by: Chenguang Zhao --- Reproduction: 1. Load the driver (interface remains down after probe). 2. Enable ntuple filters: ethtool -K ntuple on 3. Add a perfect FDIR rule while the interface is down: ethtool -N flow-type ... 4. Keep the interface down (do not bring it up). 5. Unload the driver (rmmod / PCI unbind). unregister_netdev() skips ndo_stop because the device is not IFF_UP, and without freeing the software filter list in remove, each rule leaks sizeof(struct txgbe_fdir_filter). drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c index 20c5a295c6c2..c277863baf67 100644 --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c @@ -945,6 +945,7 @@ static void txgbe_remove(struct pci_dev *pdev) netdev = wx->netdev; wx_disable_sriov(wx); unregister_netdev(netdev); + txgbe_fdir_filter_exit(wx); timer_shutdown_sync(&wx->service_timer); cancel_work_sync(&wx->service_task); -- 2.25.1