[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202412022114.TqaFj4RR-lkp@intel.com>
Date: Mon, 2 Dec 2024 21:32:13 +0800
From: kernel test robot <lkp@...el.com>
To: Vikas Gupta <vikas.gupta@...adcom.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Edwin Peer <edwin.peer@...adcom.com>,
Michael Chan <michael.chan@...adcom.com>
Subject: drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2883:32: error:
'%s' directive output may be truncated writing up to 31 bytes into a region
of size 26
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e70140ba0d2b1a30467d4af6bcfe761327b9ec95
commit: 63185eb3aa267f2844580bbd8c9c1c97516f5dbb bnxt_en: Provide stored devlink "fw" version on older firmware
date: 3 years, 1 month ago
config: x86_64-rhel-9.4-nofixup (https://download.01.org/0day-ci/archive/20241202/202412022114.TqaFj4RR-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241202/202412022114.TqaFj4RR-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412022114.TqaFj4RR-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c: In function 'bnxt_ethtool_init':
>> drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2883:32: error: '%s' directive output may be truncated writing up to 31 bytes into a region of size 26 [-Werror=format-truncation=]
2883 | "/pkg %s", buf);
| ^~ ~~~
In function 'bnxt_get_pkgver',
inlined from 'bnxt_ethtool_init' at drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:3723:3:
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c:2882:17: note: 'snprintf' output between 6 and 37 bytes into a destination of size 31
2882 | snprintf(bp->fw_ver_str + len, FW_VER_STR_LEN - len - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2883 | "/pkg %s", buf);
| ~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +2883 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
2873
2874 static void bnxt_get_pkgver(struct net_device *dev)
2875 {
2876 struct bnxt *bp = netdev_priv(dev);
2877 char buf[FW_VER_STR_LEN];
2878 int len;
2879
2880 if (!bnxt_get_pkginfo(dev, buf, sizeof(buf))) {
2881 len = strlen(bp->fw_ver_str);
2882 snprintf(bp->fw_ver_str + len, FW_VER_STR_LEN - len - 1,
> 2883 "/pkg %s", buf);
2884 }
2885 }
2886
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists