]> git.baikalelectronics.ru Git - kernel.git/commit
pktgen: use dynamic allocation for debug print buffer
authorArnd Bergmann <arnd@arndb.de>
Tue, 13 Mar 2018 20:58:39 +0000 (21:58 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Mar 2018 00:25:26 +0000 (20:25 -0400)
commit95719e6c11f427fe2f4320768f55bec1572b01c8
treed3623f2998c7f30116ddac3de20724ff341a45bc
parentc01965d909e0ada5c8a323002a8ec97397899079
pktgen: use dynamic allocation for debug print buffer

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: 77f405acd697 ("pktgen: Remove VLA usage")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/pktgen.c