Re: [PATCH v2] net: ipv6: xfrm6_state: remove VLA usage

From: Stefano Brivio
Date: Sat Mar 10 2018 - 03:44:10 EST


On Sat, 10 Mar 2018 09:40:44 +0200
Andreas Christoforou <andreaschristofo@xxxxxxxxx> wrote:

> diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c
> index b15075a..270a53a 100644
> --- a/net/ipv6/xfrm6_state.c
> +++ b/net/ipv6/xfrm6_state.c
> @@ -62,7 +62,7 @@ __xfrm6_sort(void **dst, void **src, int n, int (*cmp)(void *p), int maxclass)
> {
> int i;
> int class[XFRM_MAX_DEPTH];
> - int count[maxclass];
> + int count[XFRM_MAX_DEPTH];
>
> memset(count, 0, sizeof(count));

Can you perhaps initialize 'count' instead of calling memset(), now?

--
Stefano