linux/drivers/net
Zhu Yanjun 20e81d2c4e virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings
[ Upstream commit e3fe8d28c6 ]

Fix the warnings when building virtio_net driver.

"
drivers/net/virtio_net.c: In function ‘init_vqs’:
drivers/net/virtio_net.c:4551:48: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Wformat-overflow=]
 4551 |                 sprintf(vi->rq[i].name, "input.%d", i);
      |                                                ^~
In function ‘virtnet_find_vqs’,
    inlined from ‘init_vqs’ at drivers/net/virtio_net.c:4645:8:
drivers/net/virtio_net.c:4551:41: note: directive argument in the range [-2147483643, 65534]
 4551 |                 sprintf(vi->rq[i].name, "input.%d", i);
      |                                         ^~~~~~~~~~
drivers/net/virtio_net.c:4551:17: note: ‘sprintf’ output between 8 and 18 bytes into a destination of size 16
 4551 |                 sprintf(vi->rq[i].name, "input.%d", i);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/virtio_net.c: In function ‘init_vqs’:
drivers/net/virtio_net.c:4552:49: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size 9 [-Wformat-overflow=]
 4552 |                 sprintf(vi->sq[i].name, "output.%d", i);
      |                                                 ^~
In function ‘virtnet_find_vqs’,
    inlined from ‘init_vqs’ at drivers/net/virtio_net.c:4645:8:
drivers/net/virtio_net.c:4552:41: note: directive argument in the range [-2147483643, 65534]
 4552 |                 sprintf(vi->sq[i].name, "output.%d", i);
      |                                         ^~~~~~~~~~~
drivers/net/virtio_net.c:4552:17: note: ‘sprintf’ output between 9 and 19 bytes into a destination of size 16
 4552 |                 sprintf(vi->sq[i].name, "output.%d", i);

"

Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Signed-off-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Link: https://lore.kernel.org/r/20240104020902.2753599-1-yanjun.zhu@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-05 20:14:33 +00:00
..
appletalk
arcnet arcnet: restoring support for multiple Sohard Arcnet cards 2023-12-13 18:45:05 +01:00
bonding bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk 2024-02-05 20:14:19 +00:00
caif
can
dsa net: dsa: qca8k: put MDIO bus OF node on qca8k_mdio_register() failure 2024-02-05 20:14:25 +00:00
ethernet octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry 2024-02-05 20:14:25 +00:00
fddi
fjes fjes: fix memleaks in fjes_hw_setup 2024-01-31 16:19:05 -08:00
hamradio
hippi
hyperv hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes 2024-01-31 16:19:06 -08:00
ieee802154
ipa net: ipa: fix one GSI register field width 2023-12-03 07:33:05 +01:00
ipvlan ipvlan: add ipvlan_route_v6_outbound() helper 2023-11-28 17:19:50 +00:00
mctp
mdio
netdevsim net: netdevsim: don't try to destroy PHC on VFs 2024-01-25 15:35:59 -08:00
pcs
phy net: phy: at803x: fix passing the wrong reference for config_intr 2024-02-05 20:14:22 +00:00
plip
ppp ppp: limit MRU to 64K 2023-11-28 17:19:51 +00:00
pse-pd
slip
team team: Fix use-after-free when an option instance allocation fails 2023-12-20 17:02:02 +01:00
thunderbolt
usb net: usb: ax88179_178a: avoid two consecutive device resets 2024-02-05 20:14:19 +00:00
vmxnet3
vxlan
wan
wireguard wireguard: use DEV_STATS_INC() 2023-12-03 07:33:03 +01:00
wireless wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift() 2024-02-05 20:14:24 +00:00
wwan
xen-netback xen-netback: don't produce zero-size SKB frags 2024-01-25 15:35:41 -08:00
amt.c amt: do not use overwrapped cb area 2024-01-25 15:35:56 -08:00
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c
macvlan.c macvlan: Don't propagate promisc change to lower dev in passthru 2023-11-28 17:19:54 +00:00
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
tun.c tun: add missing rx stats accounting in tun_xdp_act 2024-01-31 16:19:01 -08:00
veth.c veth: Use tstats per-CPU traffic counters 2023-12-03 07:33:09 +01:00
virtio_net.c virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings 2024-02-05 20:14:33 +00:00
vrf.c net: Move {l,t,d}stats allocation to core and convert veth & vrf 2023-12-03 07:33:04 +01:00
vsockmon.c
xen-netfront.c