kernel_samsung_a53x/drivers/net/ethernet/marvell
Simon Horman 421ea3a3fa net: mvpp2: Increase size of queue_name buffer
[ Upstream commit 91d516d4de48532d967a77967834e00c8c53dfe6 ]

Increase size of queue_name buffer from 30 to 31 to accommodate
the largest string written to it. This avoids truncation in
the possibly unlikely case where the string is name is the
maximum size.

Flagged by gcc-14:

  .../mvpp2_main.c: In function 'mvpp2_probe':
  .../mvpp2_main.c:7636:32: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
   7636 |                  "stats-wq-%s%s", netdev_name(priv->port_list[0]->dev),
        |                                ^
  .../mvpp2_main.c:7635:9: note: 'snprintf' output between 10 and 31 bytes into a destination of size 30
   7635 |         snprintf(priv->queue_name, sizeof(priv->queue_name),
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   7636 |                  "stats-wq-%s%s", netdev_name(priv->port_list[0]->dev),
        |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   7637 |                  priv->port_count > 1 ? "+" : "");
        |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Introduced by commit 118d6298f6f0 ("net: mvpp2: add ethtool GOP statistics").
I am not flagging this as a bug as I am not aware that it is one.

Compile tested only.

Signed-off-by: Simon Horman <horms@kernel.org>
Reviewed-by: Marcin Wojtas <marcin.s.wojtas@gmail.com>
Link: https://patch.msgid.link/20240806-mvpp2-namelen-v1-1-6dc773653f2f@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:21:38 +01:00
..
mvpp2 net: mvpp2: Increase size of queue_name buffer 2024-11-23 23:21:38 +01:00
octeontx2 octeontx2-af: fix detection of IP layer 2024-11-19 14:19:44 +01:00
prestera Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mv643xx_eth.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
mvmdio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mvneta.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
mvneta_bm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mvneta_bm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pxa168_eth.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
skge.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
skge.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sky2.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
sky2.h sky2: Make sure there is at least one frag_addr available 2024-11-08 11:26:17 +01:00