[linux-next:master 3610/3956] drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:661 vmw_setup_pci_resources() warn: 'pdev' not released on lines: 674.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   b3a3cbdec55b090d22a09f75efb7c7d34cb97f25
commit: 8772c0bb58bbf98a6fdd94ddb67e23468a4338bd [3610/3956] drm/vmwgfx: Cleanup pci resource allocation
config: i386-randconfig-m021-20210118 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

New smatch warnings:
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:661 vmw_setup_pci_resources() warn: 'pdev' not released on lines: 674.

vim +/pdev +661 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

8772c0bb58bbf98a Zack Rusin        2020-11-04  645  static int vmw_setup_pci_resources(struct vmw_private *dev,
8772c0bb58bbf98a Zack Rusin        2020-11-04  646  				   unsigned long pci_id)
fb1d9738ca053ea8 Jakob Bornecrantz 2009-12-10  647  {
8772c0bb58bbf98a Zack Rusin        2020-11-04  648  	resource_size_t fifo_start;
8772c0bb58bbf98a Zack Rusin        2020-11-04  649  	resource_size_t fifo_size;
fb1d9738ca053ea8 Jakob Bornecrantz 2009-12-10  650  	int ret;
8772c0bb58bbf98a Zack Rusin        2020-11-04  651  	struct pci_dev *pdev = to_pci_dev(dev->drm.dev);
8772c0bb58bbf98a Zack Rusin        2020-11-04  652  
8772c0bb58bbf98a Zack Rusin        2020-11-04  653  	pci_set_master(pdev);
8772c0bb58bbf98a Zack Rusin        2020-11-04  654  
8772c0bb58bbf98a Zack Rusin        2020-11-04  655  	ret = pci_request_regions(pdev, "vmwgfx probe");
8772c0bb58bbf98a Zack Rusin        2020-11-04  656  	if (ret)
8772c0bb58bbf98a Zack Rusin        2020-11-04  657  		return ret;
8772c0bb58bbf98a Zack Rusin        2020-11-04  658  
8772c0bb58bbf98a Zack Rusin        2020-11-04  659  	dev->io_start = pci_resource_start(pdev, 0);
8772c0bb58bbf98a Zack Rusin        2020-11-04  660  	dev->vram_start = pci_resource_start(pdev, 1);
8772c0bb58bbf98a Zack Rusin        2020-11-04 @661  	dev->vram_size = pci_resource_len(pdev, 1);
8772c0bb58bbf98a Zack Rusin        2020-11-04  662  	fifo_start = pci_resource_start(pdev, 2);
8772c0bb58bbf98a Zack Rusin        2020-11-04  663  	fifo_size = pci_resource_len(pdev, 2);
8772c0bb58bbf98a Zack Rusin        2020-11-04  664  
8772c0bb58bbf98a Zack Rusin        2020-11-04  665  	DRM_INFO("FIFO at %pa size is %llu kiB\n",
8772c0bb58bbf98a Zack Rusin        2020-11-04  666  		 &fifo_start, (uint64_t)fifo_size / 1024);
8772c0bb58bbf98a Zack Rusin        2020-11-04  667  	dev->fifo_mem = devm_memremap(dev->drm.dev,
8772c0bb58bbf98a Zack Rusin        2020-11-04  668  				      fifo_start,
8772c0bb58bbf98a Zack Rusin        2020-11-04  669  				      fifo_size,
8772c0bb58bbf98a Zack Rusin        2020-11-04  670  				      MEMREMAP_WB);
8772c0bb58bbf98a Zack Rusin        2020-11-04  671  
8772c0bb58bbf98a Zack Rusin        2020-11-04  672  	if (unlikely(dev->fifo_mem == NULL)) {
8772c0bb58bbf98a Zack Rusin        2020-11-04  673  		DRM_ERROR("Failed mapping FIFO memory.\n");

pci_release_regions()

8772c0bb58bbf98a Zack Rusin        2020-11-04  674  		return -ENOMEM;
8772c0bb58bbf98a Zack Rusin        2020-11-04  675  	}
8772c0bb58bbf98a Zack Rusin        2020-11-04  676  
8772c0bb58bbf98a Zack Rusin        2020-11-04  677  	/*
8772c0bb58bbf98a Zack Rusin        2020-11-04  678  	 * This is approximate size of the vram, the exact size will only
8772c0bb58bbf98a Zack Rusin        2020-11-04  679  	 * be known after we read SVGA_REG_VRAM_SIZE. The PCI resource
8772c0bb58bbf98a Zack Rusin        2020-11-04  680  	 * size will be equal to or bigger than the size reported by
8772c0bb58bbf98a Zack Rusin        2020-11-04  681  	 * SVGA_REG_VRAM_SIZE.
8772c0bb58bbf98a Zack Rusin        2020-11-04  682  	 */
8772c0bb58bbf98a Zack Rusin        2020-11-04  683  	DRM_INFO("VRAM at %pa size is %llu kiB\n",
8772c0bb58bbf98a Zack Rusin        2020-11-04  684  		 &dev->vram_start, (uint64_t)dev->vram_size / 1024);
8772c0bb58bbf98a Zack Rusin        2020-11-04  685  
8772c0bb58bbf98a Zack Rusin        2020-11-04  686  	return 0;
8772c0bb58bbf98a Zack Rusin        2020-11-04  687  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux