From: kernel test robot <lkp@intel.com>
To: Justin Lai <justinlai0215@realtek.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Jakub Kicinski <kuba@kernel.org>, Joe Damato <jdamato@fastly.com>
Subject: drivers/net/ethernet/realtek/rtase/rtase_main.c:1117:52: warning: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size between 7 and 22
Date: Fri, 27 Jun 2025 13:05:17 +0200 [thread overview]
Message-ID: <202506271902.vYqvPORm-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 67a993863163cb88b1b68974c31b0d84ece4293e
commit: ef7d33e174564d6294edd00ca797e2b0aac76259 rtase: Modify the format specifier in snprintf to %u
date: 8 weeks ago
config: sparc-randconfig-2003-20250626 (https://download.01.org/0day-ci/archive/20250627/202506271902.vYqvPORm-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250627/202506271902.vYqvPORm-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506271902.vYqvPORm-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/net/ethernet/realtek/rtase/rtase_main.c: In function 'rtase_open':
>> drivers/net/ethernet/realtek/rtase/rtase_main.c:1117:52: warning: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size between 7 and 22 [-Wformat-truncation=]
snprintf(ivec->name, sizeof(ivec->name), "%s_int%u",
^~
drivers/net/ethernet/realtek/rtase/rtase_main.c:1117:45: note: directive argument in the range [0, 2147483647]
snprintf(ivec->name, sizeof(ivec->name), "%s_int%u",
^~~~~~~~~~
drivers/net/ethernet/realtek/rtase/rtase_main.c:1117:4: note: 'snprintf' output between 6 and 30 bytes into a destination of size 26
snprintf(ivec->name, sizeof(ivec->name), "%s_int%u",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tp->dev->name, i);
~~~~~~~~~~~~~~~~~
vim +1117 drivers/net/ethernet/realtek/rtase/rtase_main.c
1086
1087 static int rtase_open(struct net_device *dev)
1088 {
1089 struct rtase_private *tp = netdev_priv(dev);
1090 const struct pci_dev *pdev = tp->pdev;
1091 struct rtase_int_vector *ivec;
1092 u16 i = 0, j;
1093 int ret;
1094
1095 ivec = &tp->int_vector[0];
1096 tp->rx_buf_sz = RTASE_RX_BUF_SIZE;
1097
1098 ret = rtase_alloc_desc(tp);
1099 if (ret)
1100 return ret;
1101
1102 ret = rtase_init_ring(dev);
1103 if (ret)
1104 goto err_free_all_allocated_mem;
1105
1106 rtase_hw_config(dev);
1107
1108 if (tp->sw_flag & RTASE_SWF_MSIX_ENABLED) {
1109 ret = request_irq(ivec->irq, rtase_interrupt, 0,
1110 dev->name, ivec);
1111 if (ret)
1112 goto err_free_all_allocated_irq;
1113
1114 /* request other interrupts to handle multiqueue */
1115 for (i = 1; i < tp->int_nums; i++) {
1116 ivec = &tp->int_vector[i];
> 1117 snprintf(ivec->name, sizeof(ivec->name), "%s_int%u",
1118 tp->dev->name, i);
1119 ret = request_irq(ivec->irq, rtase_q_interrupt, 0,
1120 ivec->name, ivec);
1121 if (ret)
1122 goto err_free_all_allocated_irq;
1123 }
1124 } else {
1125 ret = request_irq(pdev->irq, rtase_interrupt, 0, dev->name,
1126 ivec);
1127 if (ret)
1128 goto err_free_all_allocated_mem;
1129 }
1130
1131 rtase_hw_start(dev);
1132
1133 for (i = 0; i < tp->int_nums; i++) {
1134 ivec = &tp->int_vector[i];
1135 napi_enable(&ivec->napi);
1136 }
1137
1138 netif_carrier_on(dev);
1139 netif_wake_queue(dev);
1140
1141 return 0;
1142
1143 err_free_all_allocated_irq:
1144 for (j = 0; j < i; j++)
1145 free_irq(tp->int_vector[j].irq, &tp->int_vector[j]);
1146
1147 err_free_all_allocated_mem:
1148 rtase_free_desc(tp);
1149
1150 return ret;
1151 }
1152
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-06-27 11:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 11:05 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-08-14 1:11 drivers/net/ethernet/realtek/rtase/rtase_main.c:1117:52: warning: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size between 7 and 22 kernel test robot
2025-12-17 14:32 kernel test robot
2026-05-13 10:45 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202506271902.vYqvPORm-lkp@intel.com \
--to=lkp@intel.com \
--cc=jdamato@fastly.com \
--cc=justinlai0215@realtek.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.