Re: [PATCH] misc: lan966x_pci: depopulate children on populate failure

From: kernel test robot

Date: Tue Jun 16 2026 - 05:39:54 EST


Hi Pengpeng,

kernel test robot noticed the following build warnings:

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on char-misc/char-misc-next char-misc/char-misc-linus soc/for-next linus/master v7.1 next-20260615]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Pengpeng-Hou/misc-lan966x_pci-depopulate-children-on-populate-failure/20260616-091550
base: char-misc/char-misc-testing
patch link: https://lore.kernel.org/r/20260616004304.95117-1-pengpeng%40iscas.ac.cn
patch subject: [PATCH] misc: lan966x_pci: depopulate children on populate failure
config: loongarch-randconfig-001-20260616 (https://download.01.org/0day-ci/archive/20260616/202606161724.uAEP4nTA-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 13.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260616/202606161724.uAEP4nTA-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606161724.uAEP4nTA-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/misc/lan966x_pci.c: In function 'lan966x_pci_probe':
>> drivers/misc/lan966x_pci.c:187:1: warning: label 'err_unload_overlay' defined but not used [-Wunused-label]
187 | err_unload_overlay:
| ^~~~~~~~~~~~~~~~~~


vim +/err_unload_overlay +187 drivers/misc/lan966x_pci.c

185686beb464996 Herve Codina 2024-10-14 138
185686beb464996 Herve Codina 2024-10-14 139 static int lan966x_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
185686beb464996 Herve Codina 2024-10-14 140 {
185686beb464996 Herve Codina 2024-10-14 141 struct device *dev = &pdev->dev;
185686beb464996 Herve Codina 2024-10-14 142 struct lan966x_pci *data;
185686beb464996 Herve Codina 2024-10-14 143 int ret;
185686beb464996 Herve Codina 2024-10-14 144
185686beb464996 Herve Codina 2024-10-14 145 /*
185686beb464996 Herve Codina 2024-10-14 146 * On ACPI system, fwnode can point to the ACPI node.
185686beb464996 Herve Codina 2024-10-14 147 * This driver needs an of_node to be used as the device-tree overlay
185686beb464996 Herve Codina 2024-10-14 148 * target. This of_node should be set by the PCI core if it succeeds in
185686beb464996 Herve Codina 2024-10-14 149 * creating it (CONFIG_PCI_DYNAMIC_OF_NODES feature).
185686beb464996 Herve Codina 2024-10-14 150 * Check here for the validity of this of_node.
185686beb464996 Herve Codina 2024-10-14 151 */
185686beb464996 Herve Codina 2024-10-14 152 if (!dev_of_node(dev))
185686beb464996 Herve Codina 2024-10-14 153 return dev_err_probe(dev, -EINVAL, "Missing of_node for device\n");
185686beb464996 Herve Codina 2024-10-14 154
185686beb464996 Herve Codina 2024-10-14 155 /* Need to be done before devm_pci_dev_create_intr_ctrl.
185686beb464996 Herve Codina 2024-10-14 156 * It allocates an IRQ and so pdev->irq is updated.
185686beb464996 Herve Codina 2024-10-14 157 */
185686beb464996 Herve Codina 2024-10-14 158 ret = pcim_enable_device(pdev);
185686beb464996 Herve Codina 2024-10-14 159 if (ret)
185686beb464996 Herve Codina 2024-10-14 160 return ret;
185686beb464996 Herve Codina 2024-10-14 161
185686beb464996 Herve Codina 2024-10-14 162 ret = devm_pci_dev_create_intr_ctrl(pdev);
185686beb464996 Herve Codina 2024-10-14 163 if (ret)
185686beb464996 Herve Codina 2024-10-14 164 return ret;
185686beb464996 Herve Codina 2024-10-14 165
185686beb464996 Herve Codina 2024-10-14 166 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
185686beb464996 Herve Codina 2024-10-14 167 if (!data)
185686beb464996 Herve Codina 2024-10-14 168 return -ENOMEM;
185686beb464996 Herve Codina 2024-10-14 169
185686beb464996 Herve Codina 2024-10-14 170 pci_set_drvdata(pdev, data);
185686beb464996 Herve Codina 2024-10-14 171 data->dev = dev;
185686beb464996 Herve Codina 2024-10-14 172
185686beb464996 Herve Codina 2024-10-14 173 ret = lan966x_pci_load_overlay(data);
185686beb464996 Herve Codina 2024-10-14 174 if (ret)
185686beb464996 Herve Codina 2024-10-14 175 return ret;
185686beb464996 Herve Codina 2024-10-14 176
185686beb464996 Herve Codina 2024-10-14 177 pci_set_master(pdev);
185686beb464996 Herve Codina 2024-10-14 178
185686beb464996 Herve Codina 2024-10-14 179 ret = of_platform_default_populate(dev_of_node(dev), NULL, dev);
185686beb464996 Herve Codina 2024-10-14 180 if (ret)
6b5a5043c64e00b Pengpeng Hou 2026-06-16 181 goto err_depopulate;
185686beb464996 Herve Codina 2024-10-14 182
185686beb464996 Herve Codina 2024-10-14 183 return 0;
185686beb464996 Herve Codina 2024-10-14 184
6b5a5043c64e00b Pengpeng Hou 2026-06-16 185 err_depopulate:
6b5a5043c64e00b Pengpeng Hou 2026-06-16 186 of_platform_depopulate(dev);
185686beb464996 Herve Codina 2024-10-14 @187 err_unload_overlay:
185686beb464996 Herve Codina 2024-10-14 188 lan966x_pci_unload_overlay(data);
185686beb464996 Herve Codina 2024-10-14 189 return ret;
185686beb464996 Herve Codina 2024-10-14 190 }
185686beb464996 Herve Codina 2024-10-14 191

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki