:::::: :::::: Manual check reason: "low confidence bisect report" :::::: Manual check reason: "low confidence static check warning: drivers/net/ethernet/sfc/siena/efx.c:885:22: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]" :::::: BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev CC: linux-kernel@vger.kernel.org TO: Martin Habets CC: Jakub Kicinski tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: b7b275e60bcd5f89771e865a8239325f86d9927d commit: c5a13c319e10e795850b61bc7e3447b08024be2e sfc: Add a basic Siena module date: 7 months ago :::::: branch date: 5 hours ago :::::: commit date: 7 months ago config: arm-randconfig-c002-20221124 compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c5a13c319e10e795850b61bc7e3447b08024be2e git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout c5a13c319e10e795850b61bc7e3447b08024be2e # save the config file COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross ARCH=arm KBUILD_USERCFLAGS='-fanalyzer -Wno-error' If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot gcc_analyzer warnings: (new ones prefixed by >>) drivers/net/ethernet/sfc/siena/efx.c: In function 'efx_probe_vpd_strings': >> drivers/net/ethernet/sfc/siena/efx.c:885:22: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 885 | unsigned int vpd_size, kw_len; | ^~~~~~~~ 'efx_probe_vpd_strings': event 1 | | 885 | unsigned int vpd_size, kw_len; | | ^~~~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/efx.c:885:32: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 885 | unsigned int vpd_size, kw_len; | ^~~~~~ 'efx_probe_vpd_strings': event 1 | | 885 | unsigned int vpd_size, kw_len; | | ^~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/efx.c: In function 'efx_pci_probe': drivers/net/ethernet/sfc/siena/efx.c:1069:39: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 1069 | unsigned char r; | ^ 'efx_pci_probe': events 1-3 | | 1034 | if (!net_dev) | | ^ | | | | | (1) following 'false' branch (when 'net_dev' is non-NULL)... | 1035 | return -ENOMEM; | 1036 | efx = netdev_priv(net_dev); | | ~~~ | | | | | (2) ...to here |...... | 1043 | if (rc) | | ~ | | | | | (3) following 'false' branch (when 'rc == 0')... | 'efx_pci_probe': event 4 | |include/linux/dev_printk.h:108:9: | 108 | ({ \ | | ^ | | | | | (4) ...to here include/linux/dev_printk.h:150:9: note: in expansion of macro 'dev_printk_index_wrap' | 150 | dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__) | | ^~~~~~~~~~~~~~~~~~~~~ include/linux/pci.h:2487:41: note: in expansion of macro 'dev_info' | 2487 | #define pci_info(pdev, fmt, arg...) dev_info(&(pdev)->dev, fmt, ##arg) | | ^~~~~~~~ drivers/net/ethernet/sfc/siena/efx.c:1046:9: note: in expansion of macro 'pci_info' | 1046 | pci_info(pci_dev, "Solarflare NIC detected\n"); | | ^~~~~~~~ | 'efx_pci_probe': events 5-11 | | 1055 | if (rc) | | ^ | | | | | (5) following 'false' branch (when 'rc == 0')... |...... | 1058 | rc = efx_pci_probe_post_io(efx); | | ~~ | | | | | (6) ...to here | 1059 | if (rc) { | | ~ | | | | | (7) following 'true' branch (when 'rc != 0')... |...... | 1063 | efx->reset_pending = 0; | | ~~~ | | | | | (8) ...to here | 1064 | rc = efx_pci_probe_post_io(efx); | 1065 | if (rc) { | | ~ | | | | | (9) following 'true' branch (when 'rc != 0')... |...... | 1069 | unsigned char r; | | ~~~~~~~~ ~ | | | | | | | (11) use of uninitialized value '' here | | (10) ...to here | -- drivers/net/ethernet/sfc/siena/rx.c: In function 'efx_do_xdp': >> drivers/net/ethernet/sfc/siena/rx.c:257:27: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 257 | struct xdp_frame *xdpf; | ^~~~ 'efx_do_xdp': event 1 | | 257 | struct xdp_frame *xdpf; | | ^~~~ | | | | | (1) use of uninitialized value '' here | -- drivers/net/ethernet/sfc/siena/ethtool.c: In function 'efx_ethtool_get_coalesce': >> drivers/net/ethernet/sfc/siena/ethtool.c:105:22: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 105 | unsigned int tx_usecs, rx_usecs; | ^~~~~~~~ 'efx_ethtool_get_coalesce': event 1 | | 105 | unsigned int tx_usecs, rx_usecs; | | ^~~~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/ethtool.c:105:32: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 105 | unsigned int tx_usecs, rx_usecs; | ^~~~~~~~ 'efx_ethtool_get_coalesce': event 1 | | 105 | unsigned int tx_usecs, rx_usecs; | | ^~~~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/ethtool.c:106:14: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 106 | bool rx_adaptive; | ^~~~~~~~~~~ 'efx_ethtool_get_coalesce': event 1 | | 106 | bool rx_adaptive; | | ^~~~~~~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/ethtool.c: In function 'efx_ethtool_set_coalesce': drivers/net/ethernet/sfc/siena/ethtool.c:126:22: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 126 | unsigned int tx_usecs, rx_usecs; | ^~~~~~~~ 'efx_ethtool_set_coalesce': event 1 | | 126 | unsigned int tx_usecs, rx_usecs; | | ^~~~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/ethtool.c:126:32: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 126 | unsigned int tx_usecs, rx_usecs; | ^~~~~~~~ 'efx_ethtool_set_coalesce': event 1 | | 126 | unsigned int tx_usecs, rx_usecs; | | ^~~~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/ethtool.c:127:14: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 127 | bool adaptive, rx_may_override_tx; | ^~~~~~~~ 'efx_ethtool_set_coalesce': event 1 | | 127 | bool adaptive, rx_may_override_tx; | | ^~~~~~~~ | | | | | (1) use of uninitialized value '' here | -- drivers/net/ethernet/sfc/siena/ptp.c: In function 'efx_ptp_get_attributes': >> drivers/net/ethernet/sfc/siena/ptp.c:636:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 636 | size_t out_len; | ^~~~~~~ 'efx_ptp_get_attributes': event 1 | | 636 | size_t out_len; | | ^~~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/ptp.c: In function 'efx_ptp_get_timestamp_corrections': drivers/net/ethernet/sfc/siena/ptp.c:733:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 733 | size_t out_len; | ^~~~~~~ 'efx_ptp_get_timestamp_corrections': event 1 | | 733 | size_t out_len; | | ^~~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/ptp.c: In function 'efx_ptp_synchronize': drivers/net/ethernet/sfc/siena/ptp.c:1029:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 1029 | size_t response_length; | ^~~~~~~~~~~~~~~ 'efx_ptp_synchronize': event 1 | | 1029 | size_t response_length; | | ^~~~~~~~~~~~~~~ | | | | | (1) use of uninitialized value '' here | In file included from include/linux/bitops.h:7, from include/linux/kernel.h:22, from include/linux/skbuff.h:13, from include/linux/ip.h:16, from drivers/net/ethernet/sfc/siena/ptp.c:33: include/linux/typecheck.h:11:19: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 11 | typeof(x) __dummy2; \ | ^~~~~~~~ include/linux/jiffies.h:106:10: note: in expansion of macro 'typecheck' 106 | typecheck(unsigned long, b) && \ | ^~~~~~~~~ include/linux/jiffies.h:108:33: note: in expansion of macro 'time_after' 108 | #define time_before(a,b) time_after(b,a) | ^~~~~~~~~~ drivers/net/ethernet/sfc/siena/ptp.c:1051:39: note: in expansion of macro 'time_before' 1051 | while (!READ_ONCE(*start) && (time_before(jiffies, timeout))) { | ^~~~~~~~~~~ 'efx_ptp_synchronize': event 1 | | 1051 | while (!READ_ONCE(*start) && (time_before(jiffies, timeout))) { | | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (1) following 'true' branch... | 'efx_ptp_synchronize': event 2 | |include/linux/jiffies.h:105:20: | 105 | (typecheck(unsigned long, a) && \ | | ^~~~~~~~ | | | | | (2) ...to here include/linux/typecheck.h:10:9: note: in definition of macro 'typecheck' | 10 | ({ type __dummy; \ | | ^~~~ include/linux/jiffies.h:108:33: note: in expansion of macro 'time_after' | 108 | #define time_before(a,b) time_after(b,a) | | ^~~~~~~~~~ drivers/net/ethernet/sfc/siena/ptp.c:1051:39: note: in expansion of macro 'time_before' | 1051 | while (!READ_ONCE(*start) && (time_before(jiffies, timeout))) { | | ^~~~~~~~~~~ | 'efx_ptp_synchronize': event 3 | |include/linux/typecheck.h:11:19: | 11 | typeof(x) __dummy2; \ | | ^~~~~~~~ | | | | | (3) use of uninitialized value '' here include/linux/jiffies.h:106:10: note: in expansion of macro 'typecheck' | 106 | typecheck(unsigned long, b) && \ | | ^~~~~~~~~ include/linux/jiffies.h:108:33: note: in expansion of macro 'time_after' | 108 | #define time_before(a,b) time_after(b,a) | | ^~~~~~~~~~ drivers/net/ethernet/sfc/siena/ptp.c:1051:39: note: in expansion of macro 'time_before' | 1051 | while (!READ_ONCE(*start) && (time_before(jiffies, timeout))) { | | ^~~~~~~~~~~ | include/linux/typecheck.h:11:19: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 11 | typeof(x) __dummy2; \ | ^~~~~~~~ include/linux/jiffies.h:106:10: note: in expansion of macro 'typecheck' 106 | typecheck(unsigned long, b) && \ | ^~~~~~~~~ include/linux/jiffies.h:108:33: note: in expansion of macro 'time_after' 108 | #define time_before(a,b) time_after(b,a) | ^~~~~~~~~~ drivers/net/ethernet/sfc/siena/ptp.c:1058:14: note: in expansion of macro 'time_before' 1058 | if (!time_before(jiffies, timeout)) -- drivers/net/ethernet/sfc/siena/mcdi_port.c: In function 'efx_mcdi_mdio_read': >> drivers/net/ethernet/sfc/siena/mcdi_port.c:26:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 26 | size_t outlen; | ^~~~~~ 'efx_mcdi_mdio_read': event 1 | | 26 | size_t outlen; | | ^~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/mcdi_port.c: In function 'efx_mcdi_mdio_write': drivers/net/ethernet/sfc/siena/mcdi_port.c:52:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 52 | size_t outlen; | ^~~~~~ 'efx_mcdi_mdio_write': event 1 | | 52 | size_t outlen; | | ^~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/mcdi_port.c: In function 'efx_siena_mcdi_mac_check_fault': drivers/net/ethernet/sfc/siena/mcdi_port.c:76:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 76 | size_t outlength; | ^~~~~~~~~ 'efx_siena_mcdi_mac_check_fault': event 1 | | 76 | size_t outlength; | | ^~~~~~~~~ | | | | | (1) use of uninitialized value '' here | -- drivers/net/ethernet/sfc/siena/mcdi_port_common.c: In function 'efx_mcdi_get_phy_cfg': >> drivers/net/ethernet/sfc/siena/mcdi_port_common.c:19:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 19 | size_t outlen; | ^~~~~~ 'efx_mcdi_get_phy_cfg': event 1 | | 19 | size_t outlen; | | ^~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/mcdi_port_common.c: In function 'efx_mcdi_loopback_modes': drivers/net/ethernet/sfc/siena/mcdi_port_common.c:90:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 90 | size_t outlen; | ^~~~~~ 'efx_mcdi_loopback_modes': event 1 | | 90 | size_t outlen; | | ^~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/mcdi_port_common.c: In function 'efx_siena_mcdi_phy_get_fecparam': drivers/net/ethernet/sfc/siena/mcdi_port_common.c:624:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 624 | size_t outlen; | ^~~~~~ 'efx_siena_mcdi_phy_get_fecparam': event 1 | | 624 | size_t outlen; | | ^~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/mcdi_port_common.c: In function 'efx_siena_mcdi_phy_test_alive': drivers/net/ethernet/sfc/siena/mcdi_port_common.c:718:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 718 | size_t outlen; | ^~~~~~ 'efx_siena_mcdi_phy_test_alive': event 1 | | 718 | size_t outlen; | | ^~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/mcdi_port_common.c: In function 'efx_mcdi_bist': drivers/net/ethernet/sfc/siena/mcdi_port_common.c:764:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 764 | size_t outlen; | ^~~~~~ 'efx_mcdi_bist': event 1 | | 764 | size_t outlen; | | ^~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/mcdi_port_common.c: In function 'efx_mcdi_phy_get_module_eeprom_page': drivers/net/ethernet/sfc/siena/mcdi_port_common.c:915:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 915 | size_t outlen; | ^~~~~~ 'efx_mcdi_phy_get_module_eeprom_page': event 1 | | 915 | size_t outlen; | | ^~~~~~ | | | | | (1) use of uninitialized value '' here | drivers/net/ethernet/sfc/siena/mcdi_port_common.c: In function 'efx_mcdi_phy_get_module_eeprom_byte': drivers/net/ethernet/sfc/siena/mcdi_port_common.c:950:12: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 950 | u8 data; | ^~~~ 'efx_mcdi_phy_get_module_eeprom_byte': event 1 | | 950 | u8 data; | | ^~~~ | | | | | (1) use of uninitialized value '' here | -- drivers/net/ethernet/sfc/siena/mcdi_mon.c: In function 'efx_siena_mcdi_mon_probe': >> drivers/net/ethernet/sfc/siena/mcdi_mon.c:310:16: warning: use of uninitialized value '' [CWE-457] [-Wanalyzer-use-of-uninitialized-value] 310 | size_t outlen; | ^~~~~~ 'efx_siena_mcdi_mon_probe': event 1 | | 310 | size_t outlen; | | ^~~~~~ | | | | | (1) use of uninitialized value '' here | vim +885 drivers/net/ethernet/sfc/siena/efx.c 6e173d3b4af9e8 Martin Habets 2022-05-09 877 6e173d3b4af9e8 Martin Habets 2022-05-09 878 /* NIC VPD information 6e173d3b4af9e8 Martin Habets 2022-05-09 879 * Called during probe to display the part number of the 6e173d3b4af9e8 Martin Habets 2022-05-09 880 * installed NIC. 6e173d3b4af9e8 Martin Habets 2022-05-09 881 */ 6e173d3b4af9e8 Martin Habets 2022-05-09 882 static void efx_probe_vpd_strings(struct efx_nic *efx) 6e173d3b4af9e8 Martin Habets 2022-05-09 883 { 6e173d3b4af9e8 Martin Habets 2022-05-09 884 struct pci_dev *dev = efx->pci_dev; 6e173d3b4af9e8 Martin Habets 2022-05-09 @885 unsigned int vpd_size, kw_len; 6e173d3b4af9e8 Martin Habets 2022-05-09 886 u8 *vpd_data; 6e173d3b4af9e8 Martin Habets 2022-05-09 887 int start; 6e173d3b4af9e8 Martin Habets 2022-05-09 888 6e173d3b4af9e8 Martin Habets 2022-05-09 889 vpd_data = pci_vpd_alloc(dev, &vpd_size); 6e173d3b4af9e8 Martin Habets 2022-05-09 890 if (IS_ERR(vpd_data)) { 6e173d3b4af9e8 Martin Habets 2022-05-09 891 pci_warn(dev, "Unable to read VPD\n"); 6e173d3b4af9e8 Martin Habets 2022-05-09 892 return; 6e173d3b4af9e8 Martin Habets 2022-05-09 893 } 6e173d3b4af9e8 Martin Habets 2022-05-09 894 6e173d3b4af9e8 Martin Habets 2022-05-09 895 start = pci_vpd_find_ro_info_keyword(vpd_data, vpd_size, 6e173d3b4af9e8 Martin Habets 2022-05-09 896 PCI_VPD_RO_KEYWORD_PARTNO, &kw_len); 6e173d3b4af9e8 Martin Habets 2022-05-09 897 if (start < 0) 6e173d3b4af9e8 Martin Habets 2022-05-09 898 pci_err(dev, "Part number not found or incomplete\n"); 6e173d3b4af9e8 Martin Habets 2022-05-09 899 else 6e173d3b4af9e8 Martin Habets 2022-05-09 900 pci_info(dev, "Part Number : %.*s\n", kw_len, vpd_data + start); 6e173d3b4af9e8 Martin Habets 2022-05-09 901 6e173d3b4af9e8 Martin Habets 2022-05-09 902 start = pci_vpd_find_ro_info_keyword(vpd_data, vpd_size, 6e173d3b4af9e8 Martin Habets 2022-05-09 903 PCI_VPD_RO_KEYWORD_SERIALNO, &kw_len); 6e173d3b4af9e8 Martin Habets 2022-05-09 904 if (start < 0) 6e173d3b4af9e8 Martin Habets 2022-05-09 905 pci_err(dev, "Serial number not found or incomplete\n"); 6e173d3b4af9e8 Martin Habets 2022-05-09 906 else 6e173d3b4af9e8 Martin Habets 2022-05-09 907 efx->vpd_sn = kmemdup_nul(vpd_data + start, kw_len, GFP_KERNEL); 6e173d3b4af9e8 Martin Habets 2022-05-09 908 6e173d3b4af9e8 Martin Habets 2022-05-09 909 kfree(vpd_data); 6e173d3b4af9e8 Martin Habets 2022-05-09 910 } 6e173d3b4af9e8 Martin Habets 2022-05-09 911 :::::: The code at line 885 was first introduced by commit :::::: 6e173d3b4af9e8804ebdbdb7a4afd7ed8f96220b sfc: Copy shared files needed for Siena (part 1) :::::: TO: Martin Habets :::::: CC: Jakub Kicinski -- 0-DAY CI Kernel Test Service https://01.org/lkp