linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Zack Rusin <zackr@vmware.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Martin Krastev <krastevm@vmware.com>,
	Roland Scheidegger <sroland@vmware.com>
Subject: [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: Tue, 19 Jan 2021 12:44:38 +0300	[thread overview]
Message-ID: <20210119094438.GM2696@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 4238 bytes --]

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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40286 bytes --]

                 reply	other threads:[~2021-01-19  9:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210119094438.GM2696@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=krastevm@vmware.com \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=sroland@vmware.com \
    --cc=zackr@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox