summaryrefslogtreecommitdiffstats
path: root/net/core/pktgen.c
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2018-03-08 23:43:40 -0600
committerDavid S. Miller <davem@davemloft.net>2018-03-09 11:57:17 -0500
commit35951393bbffa1ce351438bee264b48347c8cbb7 (patch)
tree450111bdbbfcfd0a3ce273ac63731d040de0deb7 /net/core/pktgen.c
parentff3c1b1a817d72e092fded369596dbd84e719ab8 (diff)
downloadlinux-35951393bbffa1ce351438bee264b48347c8cbb7.tar.gz
linux-35951393bbffa1ce351438bee264b48347c8cbb7.tar.bz2
linux-35951393bbffa1ce351438bee264b48347c8cbb7.zip
pktgen: Remove VLA usage
In preparation to enabling -Wvla, remove VLA usage and replace it with a fixed-length array instead. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/pktgen.c')
-rw-r--r--net/core/pktgen.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index d81bddd1bb80..e2d6ae3b290b 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -907,7 +907,7 @@ static ssize_t pktgen_if_write(struct file *file,
if (debug) {
size_t copy = min_t(size_t, count, 1023);
- char tb[copy + 1];
+ char tb[1024];
if (copy_from_user(tb, user_buffer, copy))
return -EFAULT;
tb[copy] = 0;