diff options
author | Arnd Bergmann <arnd@arndb.de> | 2017-07-14 14:07:02 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-07-14 18:03:11 +0200 |
commit | be9cdf1b97023cf5548bd4f6920bb546272ebabc (patch) | |
tree | 4ec373d2b328086faa4ec2bd72930a8a1f61ae44 /drivers/net/vmxnet3 | |
parent | net: niu: fix format string overflow warning: (diff) | |
download | linux-be9cdf1b97023cf5548bd4f6920bb546272ebabc.tar.xz linux-be9cdf1b97023cf5548bd4f6920bb546272ebabc.zip |
bnx2x: fix format overflow warning
gcc notices that large queue numbers would overflow the queue name
string:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c: In function 'bnx2x_get_strings':
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c:3165:25: error: '%d' directive writing between 1 and 10 bytes into a region of size 5 [-Werror=format-overflow=]
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c:3165:25: note: directive argument in the range [0, 2147483647]
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c:3165:5: note: 'sprintf' output between 2 and 11 bytes into a destination of size 5
There is a hard limit in place that makes the number at most two
digits, so the code is fine. This changes it to use snprintf()
to truncate instead of overflowing, which shuts up that warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vmxnet3')
0 files changed, 0 insertions, 0 deletions