From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5804FC44507 for ; Wed, 15 Jul 2026 08:31:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 0FE324065F; Wed, 15 Jul 2026 08:31:06 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id KgqgmUa70Otr; Wed, 15 Jul 2026 08:31:04 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org F3B6640650 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1784104264; bh=dQrae6Cm2MY06HGEjU3/xL5rXu67Kdy2Kb+NwAvEBps=; h=Date:To:Cc:References:From:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ObF3xc4FWS0a0RmXxR1x/uUrOPq7nweL7AVvdWIlN5bzo0VkPhG21LdVqhcFM1ny/ j5qcdE8biKEJuAu0V/eFvNwEPhJk1gWWQiU1W+a7orFqSEp5MLl1MYuz5bLE1Bs4XR ZKllZphVCc0iEp69Z3o0vNug3p/dhIby/0nsCssONAFl+AFW54rYC0iHaxFlDv9tR3 +GtA7e7rnxBLHPg8Uf7nX7nknEMzIScATDF4mx1DBiNsn/I2BUQ6ZRwzjrFlJgm8vW eVa1ZWisCtnRt/tjQd3LOyJYqa11QOtOnXxaaMy/LDuUulphCoADpcvWdz2fhj5BpN tldmc+22vtWjw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id F3B6640650; Wed, 15 Jul 2026 08:31:03 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id C4F5A203 for ; Wed, 15 Jul 2026 08:31:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B6EBD60640 for ; Wed, 15 Jul 2026 08:31:02 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Ox1h9c6v8dLs for ; Wed, 15 Jul 2026 08:31:02 +0000 (UTC) X-Greylist: delayed 19891 seconds by postgrey-1.37 at util1.osuosl.org; Wed, 15 Jul 2026 08:31:01 UTC DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org F08066063F DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F08066063F Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:41d0:1004:224b::ad; helo=out-173.mta0.migadu.com; envelope-from=xuanqiang.luo@linux.dev; receiver= Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [IPv6:2001:41d0:1004:224b::ad]) by smtp3.osuosl.org (Postfix) with ESMTPS id F08066063F for ; Wed, 15 Jul 2026 08:31:01 +0000 (UTC) Message-ID: Date: Wed, 15 Jul 2026 16:30:06 +0800 MIME-Version: 1.0 To: "Jagielski, Jedrzej" , "Nguyen, Anthony L" , "Kitszel, Przemyslaw" , "intel-wired-lan@lists.osuosl.org" Cc: Andrew Lunn , Mitch Williams , Greg Rose , Sudheer Mogilappagari , "netdev@vger.kernel.org" , Xuanqiang Luo , "stable@vger.kernel.org" References: <20260715061131.34420-1-xuanqiang.luo@linux.dev> <20260715061131.34420-2-xuanqiang.luo@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: luoxuanqiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784104257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dQrae6Cm2MY06HGEjU3/xL5rXu67Kdy2Kb+NwAvEBps=; b=BozRlNq8VOl4+ctCscuxFAqWjvKWlDxZhZ0vNzXbzqpf6ftrM/RVx1jZTju87PpDmjx5oY Ks1kx1HbxJeEzhhtBmOjUT2JC46bRzooaqV23riTSdmRwc0BOG4cBUU37TQXx48DqxsZHv Yi0dfoPdmWHvID0sLp2lCrdZZzMkBVQ= X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=BozRlNq8 Subject: Re: [Intel-wired-lan] [PATCH iwl-net v1 1/2] iavf: fix ASQ command buffer leak on init failure X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 在 2026/7/15 15:24, Jagielski, Jedrzej 写道: > From: xuanqiang.luo@linux.dev > Sent: Wednesday, July 15, 2026 8:12 AM > >> From: Xuanqiang Luo >> >> iavf_alloc_adminq_asq_ring() allocates cmd_buf before the remaining ASQ >> resources. If iavf_alloc_asq_bufs() or iavf_config_asq_regs() fails, the >> unwind path elides cmd_buf while freeing the other allocations. >> >> The ASQ count is not set until initialization succeeds, so the shutdown >> path cannot reclaim the buffer. Free cmd_buf in the common unwind path. >> >> Fixes: d358aa9a7a2d ("i40evf: init code and hardware support") >> Cc: stable@vger.kernel.org >> Signed-off-by: Xuanqiang Luo >> --- >> drivers/net/ethernet/intel/iavf/iavf_adminq.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/net/ethernet/intel/iavf/iavf_adminq.c b/drivers/net/ethernet/intel/iavf/iavf_adminq.c >> index 6937b7dd44cbb..82a32f8e78c12 100644 >> --- a/drivers/net/ethernet/intel/iavf/iavf_adminq.c >> +++ b/drivers/net/ethernet/intel/iavf/iavf_adminq.c >> @@ -346,6 +346,7 @@ static enum iavf_status iavf_init_asq(struct iavf_hw *hw) >> iavf_free_virt_mem(hw, &hw->aq.asq.dma_head); >> >> init_adminq_free_rings: >> + iavf_free_virt_mem(hw, &hw->aq.asq.cmd_buf); > Hi Xuanqiang > much thanks for the patches! > > how about moving that line directly into iavf_free_adminq_asq()? > then free func would be paired 1:1 with alloc func Thanks for the suggestion! I've addressed it and sent out v2. > >> iavf_free_adminq_asq(hw); >> >> init_adminq_exit: >> -- >> 2.43.0