Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [leon-rdma:dmabuf-vfio 19/27] drivers/pci/p2pdma.c:265:11: warning: variable 'i' is uninitialized when used here
@ 2025-09-08  5:29 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-09-08  5:29 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git dmabuf-vfio
head:   9bc352426598d13cfd13f8f031157d2b8a674cf1
commit: bb2ce8171dbc417c167ca7cabc946e39728432a5 [19/27] PCI/P2PDMA: Refactor to separate core P2P functionality from memory allocation
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250908/202509081306.Kn97CBcM-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250908/202509081306.Kn97CBcM-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/202509081306.Kn97CBcM-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/pci/p2pdma.c:265:11: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
     265 |         p2p->mem[i].owner = &pdev->dev;
         |                  ^
   drivers/pci/p2pdma.c:253:7: note: initialize the variable 'i' to silence this warning
     253 |         int i, ret;
         |              ^
         |               = 0
   1 warning generated.


vim +/i +265 drivers/pci/p2pdma.c

   241	
   242	/**
   243	 * pci_p2pdma_enable - Enable peer-to-peer DMA support for a PCI device
   244	 * @pdev: The PCI device to enable P2PDMA for
   245	 *
   246	 * This function initializes the peer-to-peer DMA infrastructure for a PCI
   247	 * device. It allocates and sets up the necessary data structures to support
   248	 * P2PDMA operations, including mapping type tracking.
   249	 */
   250	struct p2pdma_provider *pci_p2pdma_enable(struct pci_dev *pdev)
   251	{
   252		struct pci_p2pdma *p2p;
   253		int i, ret;
   254	
   255		p2p = rcu_dereference_protected(pdev->p2pdma, 1);
   256		if (p2p)
   257			/* PCI device was "rebound" to the driver */
   258			return p2p->mem;
   259	
   260		p2p = devm_kzalloc(&pdev->dev, sizeof(*p2p), GFP_KERNEL);
   261		if (!p2p)
   262			return ERR_PTR(-ENOMEM);
   263	
   264		xa_init(&p2p->map_types);
 > 265		p2p->mem[i].owner = &pdev->dev;
   266		for (i = 0; i < PCI_STD_NUM_BARS; i++)
   267			p2p->mem[i].bus_offset =
   268				pci_bus_address(pdev, i) - pci_resource_start(pdev, i);
   269	
   270		ret = devm_add_action_or_reset(&pdev->dev, pci_p2pdma_release, pdev);
   271		if (ret)
   272			goto out_p2p;
   273	
   274		rcu_assign_pointer(pdev->p2pdma, p2p);
   275		return p2p->mem;
   276	
   277	out_p2p:
   278		devm_kfree(&pdev->dev, p2p);
   279		return ERR_PTR(ret);
   280	}
   281	EXPORT_SYMBOL_GPL(pci_p2pdma_enable);
   282	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-08  5:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-08  5:29 [leon-rdma:dmabuf-vfio 19/27] drivers/pci/p2pdma.c:265:11: warning: variable 'i' is uninitialized when used here kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox