From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wang Jian Subject: Re: [PATCH] pktgen: use dynamic allocation for debug print buffer Date: Wed, 14 Mar 2018 11:02:57 +0800 Message-ID: References: <20180313205856.3309750-1-arnd@arndb.de> <20180313.202552.1990425972566331246.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: arnd@arndb.de, gustavo@embeddedor.com, dima@arista.com, johannes.berg@intel.com, edumazet@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: David Miller Return-path: In-Reply-To: <20180313.202552.1990425972566331246.davem@davemloft.net> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org >> + kfree(buf); free tb? buf is an array. On Wed, Mar 14, 2018 at 8:25 AM, David Miller wrote: > From: Arnd Bergmann > Date: Tue, 13 Mar 2018 21:58:39 +0100 > >> After the removal of the VLA, we get a harmless warning about a large >> stack frame: >> >> net/core/pktgen.c: In function 'pktgen_if_write': >> net/core/pktgen.c:1710:1: error: the frame size of 1076 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] >> >> The function was previously shown to be safe despite hitting >> the 1024 bye warning level. To get rid of the annoyging warning, >> while keeping it readable, this changes it to use strndup_user(). >> >> Obviously this is not a fast path, so the kmalloc() overhead >> can be disregarded. >> >> Fixes: 35951393bbff ("pktgen: Remove VLA usage") >> Signed-off-by: Arnd Bergmann > > Applied, thanks.