[openeuler:OLK-6.6 3058/3058] drivers/net/ethernet/huawei/hinic3/hw/hinic3_lld.c:1107:14: warning: allocation of insufficient size '8' for type 'struct hinic3_hw_pf_infos' with size '1156'
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 3ecf87d6cde5142e8e8620915713663346d033fe commit: dcb286ce50a35a77e51b61db72c7cc001647b598 [3058/3058] net/hinic3: add huawei/hinic3 driver config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20251029/202510291437.zwcK1qlA-lkp@i...) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d1c086e82af239b245fe8d7832f2753436634990) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251029/202510291437.zwcK1qlA-lkp@i...) 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/202510291437.zwcK1qlA-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from <built-in>:3: In file included from include/linux/compiler_types.h:150: include/linux/compiler-clang.h:42:9: warning: '__SANITIZE_THREAD__' macro redefined [-Wmacro-redefined] 42 | #define __SANITIZE_THREAD__ | ^ <built-in>:368:9: note: previous definition is here 368 | #define __SANITIZE_THREAD__ 1 | ^ In file included from drivers/net/ethernet/huawei/hinic3/hw/hinic3_lld.c:6: In file included from include/net/addrconf.h:52: In file included from include/linux/ipv6.h:100: In file included from include/linux/tcp.h:17: In file included from include/linux/skbuff.h:17: In file included from include/linux/bvec.h:10: In file included from include/linux/highmem.h:8: In file included from include/linux/cacheflush.h:5: In file included from arch/arm64/include/asm/cacheflush.h:11: In file included from include/linux/kgdb.h:19: In file included from include/linux/kprobes.h:28: In file included from include/linux/ftrace.h:13: In file included from include/linux/kallsyms.h:13: In file included from include/linux/mm.h:2193: include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 508 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 509 | item]; | ~~~~ include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 515 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 516 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 527 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 528 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:536:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 536 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 537 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/huawei/hinic3/hw/hinic3_lld.c:69:6: warning: no previous prototype for function 'hinic3_uld_lock_init' [-Wmissing-prototypes] 69 | void hinic3_uld_lock_init(void) | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_lld.c:69:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 69 | void hinic3_uld_lock_init(void) | ^ | static
drivers/net/ethernet/huawei/hinic3/hw/hinic3_lld.c:1107:14: warning: allocation of insufficient size '8' for type 'struct hinic3_hw_pf_infos' with size '1156' [-Walloc-size] 1107 | *pf_infos = kzalloc(sizeof(*pf_infos), GFP_KERNEL); | ^ 8 warnings generated.
vim +1107 drivers/net/ethernet/huawei/hinic3/hw/hinic3_lld.c 1094 1095 static int hinic3_get_pf_info(struct pci_dev *pdev, u16 service, 1096 struct hinic3_hw_pf_infos **pf_infos) 1097 { 1098 struct hinic3_pcidev *dev = pci_get_drvdata(pdev); 1099 int err; 1100 1101 if (service >= SERVICE_T_MAX) { 1102 sdk_err(&pdev->dev, "Current vf do not supports set service_type = %u state in host\n", 1103 service); 1104 return -EFAULT; 1105 } 1106
1107 *pf_infos = kzalloc(sizeof(*pf_infos), GFP_KERNEL); 1108 err = hinic3_get_hw_pf_infos(dev->hwdev, *pf_infos, HINIC3_CHANNEL_COMM); 1109 if (err) { 1110 kfree(*pf_infos); 1111 sdk_err(&pdev->dev, "Get chipf pf info failed, ret %d\n", err); 1112 return -EFAULT; 1113 } 1114 1115 return 0; 1116 } 1117
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot