linux/drivers/net/ethernet/engleder
Gerhard Engleder 00e984cb98 tsnep: Fix tsnep_request_irq() format-overflow warning
Compiler warns about a possible format-overflow in tsnep_request_irq():
drivers/net/ethernet/engleder/tsnep_main.c:884:55: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
                         sprintf(queue->name, "%s-rx-%d", name,
                                                       ^
drivers/net/ethernet/engleder/tsnep_main.c:881:55: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
                         sprintf(queue->name, "%s-tx-%d", name,
                                                       ^
drivers/net/ethernet/engleder/tsnep_main.c:878:49: warning: '-txrx-' directive writing 6 bytes into a region of size between 5 and 25 [-Wformat-overflow=]
                         sprintf(queue->name, "%s-txrx-%d", name,
                                                 ^~~~~~

Actually overflow cannot happen. Name is limited to IFNAMSIZ, because
netdev_name() is called during ndo_open(). queue_index is single char,
because less than 10 queues are supported.

Fix warning with snprintf(). Additionally increase buffer to 32 bytes,
because those 7 additional bytes were unused anyway.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202310182028.vmDthIUa-lkp@intel.com/
Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20231023183856.58373-1-gerhard@engleder-embedded.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-10-24 13:05:28 -07:00
..
Kconfig tsnep: Use page pool for RX 2022-09-30 11:32:27 +01:00
Makefile tsnep: Support XDP BPF program setup 2023-01-18 13:17:06 +00:00
tsnep_ethtool.c tsnep: Fix ethtool channels 2023-09-18 10:42:36 +01:00
tsnep_hw.h tsnep: Inline small fragments within TX descriptor 2023-10-16 09:59:34 +01:00
tsnep_main.c tsnep: Fix tsnep_request_irq() format-overflow warning 2023-10-24 13:05:28 -07:00
tsnep_ptp.c tsnep: Add free running cycle counter support 2022-05-10 09:48:09 +02:00
tsnep_rxnfc.c tsnep: Add EtherType RX flow classification support 2022-09-30 11:32:27 +01:00
tsnep_selftests.c net/sched: taprio: replace tc_taprio_qopt_offload :: enable with a "cmd" enum 2023-05-31 10:00:30 +01:00
tsnep_tc.c net/sched: taprio: replace tc_taprio_qopt_offload :: enable with a "cmd" enum 2023-05-31 10:00:30 +01:00
tsnep_xdp.c tsnep: Add XDP socket zero-copy RX support 2023-04-24 18:22:38 -07:00
tsnep.h tsnep: Fix tsnep_request_irq() format-overflow warning 2023-10-24 13:05:28 -07:00