From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 8FF6235A3A9 for ; Wed, 15 Jul 2026 08:30:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784104262; cv=none; b=CgTTjnzaOaNA3fkOhseQse2DSxzHoGw/7agJpNfbgD1lV7eizTXCMaEYWAk1dGBOCEkXRI6bmrc+yfqM3gLWsC+rdi9T60Cjn2ZFQugN7tMpdWYyodZ5xeHy/eJBkmGlhWPCTAJ8JKoPE77L/+WryptS2YCZVFqTSjd8ja4poXE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784104262; c=relaxed/simple; bh=fsO3AO0raATK8j0HGKAwPovfT+eHZM8MEFa0Mee9Bms=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VBOpw8yo/J/RTDmRWiPvUFVxHYV+vymD3IqgKheXAodF1pWkjfaxV3dfjrJU0MXRLLAgSORBjb4tFQtx1Twv3B+I2k49XUuGgEBWd35CAkGRSKRtqhrsttIQkGbCq56rl9Fohgw96ANped3xFmHDaXvhm6WP0WQzv1Dvu0YtNm4= 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=BozRlNq8; arc=none smtp.client-ip=91.218.175.182 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="BozRlNq8" Message-ID: 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= Date: Wed, 15 Jul 2026 16:30:06 +0800 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH iwl-net v1 1/2] iavf: fix ASQ command buffer leak on init failure 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 在 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