From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH v2] net: dsa: Remove VLA usage Date: Thu, 19 Jul 2018 07:08:58 +0900 (KST) Message-ID: <20180719.070858.620001411860238690.davem@davemloft.net> References: <20180717041034.GA37382@beast> <20180719.053333.396851874410198344.davem@davemloft.net> <20180718203725.GD20228@lunn.ch> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: keescook@chromium.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, s.mesoraca16@gmail.com, f.fainelli@gmail.com, David.Laight@aculab.com To: andrew@lunn.ch Return-path: In-Reply-To: <20180718203725.GD20228@lunn.ch> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Andrew Lunn Date: Wed, 18 Jul 2018 22:37:25 +0200 > On Thu, Jul 19, 2018 at 05:33:33AM +0900, David Miller wrote: >> From: Kees Cook >> Date: Mon, 16 Jul 2018 21:10:34 -0700 >> >> > From: Salvatore Mesoraca >> > >> > We avoid 2 VLAs by using a pre-allocated field in dsa_switch. We also >> > try to avoid dynamic allocation whenever possible (when using fewer than >> > bits-per-long ports, which is the common case). >> > >> > Link: http://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com >> > Link: http://lkml.kernel.org/r/20180505185145.GB32630@lunn.ch >> > Signed-off-by: Salvatore Mesoraca >> > [kees: tweak commit subject and message slightly] >> > Signed-off-by: Kees Cook >> >> Florian and Andrew, please review. > > Last time there was some discussion of just always allocating it to > make the code simpler. But the extra complexity is O.K. > > Reviewed-by: Andrew Lunn Great, applied, thanks!