Re: [PATCH] cxgb3: remove VLA

From: Gustavo A. R. Silva
Date: Wed Mar 07 2018 - 12:30:49 EST




On 03/07/2018 11:25 AM, David Miller wrote:
From: "Gustavo A. R. Silva" <gustavo@xxxxxxxxxxxxxx>
Date: Mon, 5 Mar 2018 23:39:34 -0600

In preparation to enabling -Wvla, remove VLA and replace it
with dynamic memory allocation.

Signed-off-by: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>

All of these lengths are limited by the encoding of the field in the
VPD, which is a u8, and thus 255 bytes.

Please just change the 'len' argument to these functions to a u8 and
use a 256 byte buffer on the stack.

Thanks.



OK. I got it.

Thanks for the feedback.
--
Gustavo