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 9A2BAE936FC for ; Fri, 6 Oct 2023 11:16:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 3486641B7E; Fri, 6 Oct 2023 11:16:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3486641B7E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1696591001; bh=fAY7Z7nzUYV5koPYz2yz3YrgB2qSm3NK/qMW9T5wxxQ=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=0bqfFBsSp0aEfdl2IQmKr4WaYc8Incrkkg+l2HyV5Oia3plY7B9h9HNLJ9XsAxP2D A2d15Nhp1WSVUQFnC/4Js+HyX5KkPxvWarZ9iN1QBmS7l1sbIQhTR/NTiS07Qszkrr NLiiUswlIv27A5s5+7Pfnax9AQOOK/mlV0RAEj83L4P7itBdLHtxTfDUFs7eo9MUnu HQ3J4v1FL4r27fHscJLMf0aLovE/c1C8zp8inouZmwE1czgujIRyDqeWlgByPGVOZI EAD8lbworynHhmiDFkpT1qjTCf/NM+JYB6NlE2G//+iMfCLQj4yB4PGNhkOrBnNbg1 Q1W3gAGkVYYRg== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0ZRysvHMXSIP; Fri, 6 Oct 2023 11:16:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id DF10041DE4; Fri, 6 Oct 2023 11:16:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DF10041DE4 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 511481BF4E3 for ; Fri, 6 Oct 2023 11:16:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 296B881E9D for ; Fri, 6 Oct 2023 11:16:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 296B881E9D X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sXXzIwRwfuG9 for ; Fri, 6 Oct 2023 11:16:37 +0000 (UTC) Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by smtp1.osuosl.org (Postfix) with ESMTPS id D62C981E62 for ; Fri, 6 Oct 2023 11:16:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D62C981E62 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 6BABDCE26ED; Fri, 6 Oct 2023 11:16:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 684E9C43397; Fri, 6 Oct 2023 11:16:29 +0000 (UTC) Date: Fri, 6 Oct 2023 13:16:27 +0200 From: Simon Horman To: Dan Carpenter Message-ID: References: <3cee09b8-4c49-4a39-b889-75c0798dfe1c@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3cee09b8-4c49-4a39-b889-75c0798dfe1c@moroto.mountain> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696590991; bh=/9ry5KltDfiR7VrvMhHB0ZYHyVGwugubCOANKdLFAf4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E6tGswAjsXMdB6tRqQ2T0pnrSjTOgtO5Jhu8lFi6WFuMYQfgghdZjv7iBzYcstWWx btkRhHPzjKM8my2Waw0lXE3MN7xHnTzI7lt8BAlwpIbgpLUT2Lp3LqeBX8YEkPm2jy d8XeBihAfvwjQDJ7jbgBqbOYeUcH6Ng1keExewCTitN/Og0RKyI13c3FQKXw0Uc5Vi +3fH5fhxKfLqdFce9pmy64pfz3dniuX3TQ4le5qR6j4wPD6NcDO5j8eUDNCOPXuDb0 BYbth7IhYR1MXprOPdyIF9hEcLmQWePVuBTtNC4q+7nxAPMN9DPxTK1xZpvNfuPt1/ 7H7mHHA67/U1g== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=E6tGswAj Subject: Re: [Intel-wired-lan] [PATCH net] ixgbe: fix crash with empty VF macvlan list X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-wired-lan@lists.osuosl.org, kernel-janitors@vger.kernel.org, Jesse Brandeburg , Greg Rose , Eric Dumazet , Tony Nguyen , Jeff Kirsher , netdev@vger.kernel.org, Jakub Kicinski , Paolo Abeni , "David S. Miller" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Thu, Oct 05, 2023 at 04:57:02PM +0300, Dan Carpenter wrote: > The adapter->vf_mvs.l list needs to be initialized even if the list is > empty. Otherwise it will lead to crashes. > > Fixes: c6bda30a06d9 ("ixgbe: Reconfigure SR-IOV Init") Hi Dan, I see that the patch cited above added the line you are changing. But it also seems to me that patch was moving it from elsewhere. Perhaps I am mistaken, but I wonder if this is a better tag. Fixes: a1cbb15c1397 ("ixgbe: Add macvlan support for VF") > Signed-off-by: Dan Carpenter > --- > drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c > index a703ba975205..9cfdfa8a4355 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c > @@ -28,6 +28,9 @@ static inline void ixgbe_alloc_vf_macvlans(struct ixgbe_adapter *adapter, > struct vf_macvlans *mv_list; > int num_vf_macvlans, i; > > + /* Initialize list of VF macvlans */ > + INIT_LIST_HEAD(&adapter->vf_mvs.l); > + > num_vf_macvlans = hw->mac.num_rar_entries - > (IXGBE_MAX_PF_MACVLANS + 1 + num_vfs); > if (!num_vf_macvlans) > @@ -36,8 +39,6 @@ static inline void ixgbe_alloc_vf_macvlans(struct ixgbe_adapter *adapter, > mv_list = kcalloc(num_vf_macvlans, sizeof(struct vf_macvlans), > GFP_KERNEL); > if (mv_list) { I'm not sure it it is worth it, but perhaps more conventional error handling could be used here: if (!mv_list) return; for (i = 0; i < num_vf_macvlans; i++) { ... > - /* Initialize list of VF macvlans */ > - INIT_LIST_HEAD(&adapter->vf_mvs.l); > for (i = 0; i < num_vf_macvlans; i++) { > mv_list[i].vf = -1; > mv_list[i].free = true; > -- > 2.39.2 > > _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan