Skip to content

Commit 91d516d

Browse files
hormskuba-moo
authored andcommitted
net: mvpp2: Increase size of queue_name buffer
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 118d629 ("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 <[email protected]> Reviewed-by: Marcin Wojtas <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 7d70ed9 commit 91d516d

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/marvell/mvpp2

1 file changed

+1
-1
lines changed

drivers/net/ethernet/marvell/mvpp2/mvpp2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ struct mvpp2 {
10881088
unsigned int max_port_rxqs;
10891089

10901090
/* Workqueue to gather hardware statistics */
1091-
char queue_name[30];
1091+
char queue_name[31];
10921092
struct workqueue_struct *stats_queue;
10931093

10941094
/* Debugfs root entry */

0 commit comments

Comments
 (0)