All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org, Tony Luck <tony.luck@intel.com>
Subject: drivers/edac/i10nm_base.c:256 i10nm_get_hbm_munits() warn: 'mbase' not released on lines: 249.
Date: Fri, 17 Dec 2021 10:20:18 +0300	[thread overview]
Message-ID: <202112161000.15tF7PTx-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2b14864acbaaf03d9c01982e243a84632524c3ac
commit: c945088384d00e6eb61535cc4ba25bc062090909 EDAC/i10nm: Add support for high bandwidth memory
config: x86_64-randconfig-m001-20211215 (https://download.01.org/0day-ci/archive/20211216/202112161000.15tF7PTx-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 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>

smatch warnings:
drivers/edac/i10nm_base.c:256 i10nm_get_hbm_munits() warn: 'mbase' not released on lines: 249.

vim +/mbase +256 drivers/edac/i10nm_base.c

c945088384d00e Qiuxu Zhuo 2021-06-11  187  static int i10nm_get_hbm_munits(void)
c945088384d00e Qiuxu Zhuo 2021-06-11  188  {
c945088384d00e Qiuxu Zhuo 2021-06-11  189  	struct pci_dev *mdev;
c945088384d00e Qiuxu Zhuo 2021-06-11  190  	void __iomem *mbase;
c945088384d00e Qiuxu Zhuo 2021-06-11  191  	u32 reg, off, mcmtr;
c945088384d00e Qiuxu Zhuo 2021-06-11  192  	struct skx_dev *d;
c945088384d00e Qiuxu Zhuo 2021-06-11  193  	int i, lmc;
c945088384d00e Qiuxu Zhuo 2021-06-11  194  	u64 base;
c945088384d00e Qiuxu Zhuo 2021-06-11  195  
c945088384d00e Qiuxu Zhuo 2021-06-11  196  	list_for_each_entry(d, i10nm_edac_list, list) {
c945088384d00e Qiuxu Zhuo 2021-06-11  197  		d->pcu_cr3 = pci_get_dev_wrapper(d->seg, d->bus[1], 30, 3);
c945088384d00e Qiuxu Zhuo 2021-06-11  198  		if (!d->pcu_cr3)
c945088384d00e Qiuxu Zhuo 2021-06-11  199  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  200  
c945088384d00e Qiuxu Zhuo 2021-06-11  201  		if (!i10nm_check_hbm_imc(d)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  202  			i10nm_printk(KERN_DEBUG, "No hbm memory\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  203  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  204  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  205  
c945088384d00e Qiuxu Zhuo 2021-06-11  206  		if (I10NM_GET_SCK_BAR(d, reg)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  207  			i10nm_printk(KERN_ERR, "Failed to get socket bar\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  208  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  209  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  210  		base = I10NM_GET_SCK_MMIO_BASE(reg);
c945088384d00e Qiuxu Zhuo 2021-06-11  211  
c945088384d00e Qiuxu Zhuo 2021-06-11  212  		if (I10NM_GET_HBM_IMC_BAR(d, reg)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  213  			i10nm_printk(KERN_ERR, "Failed to get hbm mc bar\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  214  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  215  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  216  		base += I10NM_GET_HBM_IMC_MMIO_OFFSET(reg);
c945088384d00e Qiuxu Zhuo 2021-06-11  217  
c945088384d00e Qiuxu Zhuo 2021-06-11  218  		lmc = I10NM_NUM_DDR_IMC;
c945088384d00e Qiuxu Zhuo 2021-06-11  219  
c945088384d00e Qiuxu Zhuo 2021-06-11  220  		for (i = 0; i < I10NM_NUM_HBM_IMC; i++) {
c945088384d00e Qiuxu Zhuo 2021-06-11  221  			mdev = pci_get_dev_wrapper(d->seg, d->bus[0],
c945088384d00e Qiuxu Zhuo 2021-06-11  222  						   12 + i / 4, 1 + i % 4);
c945088384d00e Qiuxu Zhuo 2021-06-11  223  			if (i == 0 && !mdev) {
c945088384d00e Qiuxu Zhuo 2021-06-11  224  				i10nm_printk(KERN_ERR, "No hbm mc found\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  225  				return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  226  			}
c945088384d00e Qiuxu Zhuo 2021-06-11  227  			if (!mdev)
c945088384d00e Qiuxu Zhuo 2021-06-11  228  				continue;
c945088384d00e Qiuxu Zhuo 2021-06-11  229  
c945088384d00e Qiuxu Zhuo 2021-06-11  230  			d->imc[lmc].mdev = mdev;
c945088384d00e Qiuxu Zhuo 2021-06-11  231  			off = i * I10NM_HBM_IMC_MMIO_SIZE;
c945088384d00e Qiuxu Zhuo 2021-06-11  232  
c945088384d00e Qiuxu Zhuo 2021-06-11  233  			edac_dbg(2, "hbm mc%d mmio base 0x%llx size 0x%x\n",
c945088384d00e Qiuxu Zhuo 2021-06-11  234  				 lmc, base + off, I10NM_HBM_IMC_MMIO_SIZE);
c945088384d00e Qiuxu Zhuo 2021-06-11  235  
c945088384d00e Qiuxu Zhuo 2021-06-11  236  			mbase = ioremap(base + off, I10NM_HBM_IMC_MMIO_SIZE);
                                                                ^^^^^^^^^^^^^^^^

c945088384d00e Qiuxu Zhuo 2021-06-11  237  			if (!mbase) {
c945088384d00e Qiuxu Zhuo 2021-06-11  238  				i10nm_printk(KERN_ERR, "Failed to ioremap for hbm mc 0x%llx\n",
c945088384d00e Qiuxu Zhuo 2021-06-11  239  					     base + off);
c945088384d00e Qiuxu Zhuo 2021-06-11  240  				return -ENOMEM;
c945088384d00e Qiuxu Zhuo 2021-06-11  241  			}
c945088384d00e Qiuxu Zhuo 2021-06-11  242  
c945088384d00e Qiuxu Zhuo 2021-06-11  243  			d->imc[lmc].mbase = mbase;
c945088384d00e Qiuxu Zhuo 2021-06-11  244  			d->imc[lmc].hbm_mc = true;
c945088384d00e Qiuxu Zhuo 2021-06-11  245  
c945088384d00e Qiuxu Zhuo 2021-06-11  246  			mcmtr = I10NM_GET_MCMTR(&d->imc[lmc], 0);
c945088384d00e Qiuxu Zhuo 2021-06-11  247  			if (!I10NM_IS_HBM_IMC(mcmtr)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  248  				i10nm_printk(KERN_ERR, "This isn't an hbm mc!\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  249  				return -ENODEV;

No clean up before the return.

c945088384d00e Qiuxu Zhuo 2021-06-11  250  			}
c945088384d00e Qiuxu Zhuo 2021-06-11  251  
c945088384d00e Qiuxu Zhuo 2021-06-11  252  			lmc++;
c945088384d00e Qiuxu Zhuo 2021-06-11  253  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  254  	}
c945088384d00e Qiuxu Zhuo 2021-06-11  255  
c945088384d00e Qiuxu Zhuo 2021-06-11 @256  	return 0;
c945088384d00e Qiuxu Zhuo 2021-06-11  257  }

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


WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/edac/i10nm_base.c:256 i10nm_get_hbm_munits() warn: 'mbase' not released on lines: 249.
Date: Thu, 16 Dec 2021 10:01:10 +0800	[thread overview]
Message-ID: <202112161000.15tF7PTx-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
CC: Tony Luck <tony.luck@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2b14864acbaaf03d9c01982e243a84632524c3ac
commit: c945088384d00e6eb61535cc4ba25bc062090909 EDAC/i10nm: Add support for high bandwidth memory
date:   6 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 6 months ago
config: x86_64-randconfig-m001-20211215 (https://download.01.org/0day-ci/archive/20211216/202112161000.15tF7PTx-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 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>

smatch warnings:
drivers/edac/i10nm_base.c:256 i10nm_get_hbm_munits() warn: 'mbase' not released on lines: 249.

vim +/mbase +256 drivers/edac/i10nm_base.c

c945088384d00e Qiuxu Zhuo 2021-06-11  186  
c945088384d00e Qiuxu Zhuo 2021-06-11  187  static int i10nm_get_hbm_munits(void)
c945088384d00e Qiuxu Zhuo 2021-06-11  188  {
c945088384d00e Qiuxu Zhuo 2021-06-11  189  	struct pci_dev *mdev;
c945088384d00e Qiuxu Zhuo 2021-06-11  190  	void __iomem *mbase;
c945088384d00e Qiuxu Zhuo 2021-06-11  191  	u32 reg, off, mcmtr;
c945088384d00e Qiuxu Zhuo 2021-06-11  192  	struct skx_dev *d;
c945088384d00e Qiuxu Zhuo 2021-06-11  193  	int i, lmc;
c945088384d00e Qiuxu Zhuo 2021-06-11  194  	u64 base;
c945088384d00e Qiuxu Zhuo 2021-06-11  195  
c945088384d00e Qiuxu Zhuo 2021-06-11  196  	list_for_each_entry(d, i10nm_edac_list, list) {
c945088384d00e Qiuxu Zhuo 2021-06-11  197  		d->pcu_cr3 = pci_get_dev_wrapper(d->seg, d->bus[1], 30, 3);
c945088384d00e Qiuxu Zhuo 2021-06-11  198  		if (!d->pcu_cr3)
c945088384d00e Qiuxu Zhuo 2021-06-11  199  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  200  
c945088384d00e Qiuxu Zhuo 2021-06-11  201  		if (!i10nm_check_hbm_imc(d)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  202  			i10nm_printk(KERN_DEBUG, "No hbm memory\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  203  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  204  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  205  
c945088384d00e Qiuxu Zhuo 2021-06-11  206  		if (I10NM_GET_SCK_BAR(d, reg)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  207  			i10nm_printk(KERN_ERR, "Failed to get socket bar\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  208  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  209  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  210  		base = I10NM_GET_SCK_MMIO_BASE(reg);
c945088384d00e Qiuxu Zhuo 2021-06-11  211  
c945088384d00e Qiuxu Zhuo 2021-06-11  212  		if (I10NM_GET_HBM_IMC_BAR(d, reg)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  213  			i10nm_printk(KERN_ERR, "Failed to get hbm mc bar\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  214  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  215  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  216  		base += I10NM_GET_HBM_IMC_MMIO_OFFSET(reg);
c945088384d00e Qiuxu Zhuo 2021-06-11  217  
c945088384d00e Qiuxu Zhuo 2021-06-11  218  		lmc = I10NM_NUM_DDR_IMC;
c945088384d00e Qiuxu Zhuo 2021-06-11  219  
c945088384d00e Qiuxu Zhuo 2021-06-11  220  		for (i = 0; i < I10NM_NUM_HBM_IMC; i++) {
c945088384d00e Qiuxu Zhuo 2021-06-11  221  			mdev = pci_get_dev_wrapper(d->seg, d->bus[0],
c945088384d00e Qiuxu Zhuo 2021-06-11  222  						   12 + i / 4, 1 + i % 4);
c945088384d00e Qiuxu Zhuo 2021-06-11  223  			if (i == 0 && !mdev) {
c945088384d00e Qiuxu Zhuo 2021-06-11  224  				i10nm_printk(KERN_ERR, "No hbm mc found\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  225  				return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  226  			}
c945088384d00e Qiuxu Zhuo 2021-06-11  227  			if (!mdev)
c945088384d00e Qiuxu Zhuo 2021-06-11  228  				continue;
c945088384d00e Qiuxu Zhuo 2021-06-11  229  
c945088384d00e Qiuxu Zhuo 2021-06-11  230  			d->imc[lmc].mdev = mdev;
c945088384d00e Qiuxu Zhuo 2021-06-11  231  			off = i * I10NM_HBM_IMC_MMIO_SIZE;
c945088384d00e Qiuxu Zhuo 2021-06-11  232  
c945088384d00e Qiuxu Zhuo 2021-06-11  233  			edac_dbg(2, "hbm mc%d mmio base 0x%llx size 0x%x\n",
c945088384d00e Qiuxu Zhuo 2021-06-11  234  				 lmc, base + off, I10NM_HBM_IMC_MMIO_SIZE);
c945088384d00e Qiuxu Zhuo 2021-06-11  235  
c945088384d00e Qiuxu Zhuo 2021-06-11  236  			mbase = ioremap(base + off, I10NM_HBM_IMC_MMIO_SIZE);
c945088384d00e Qiuxu Zhuo 2021-06-11  237  			if (!mbase) {
c945088384d00e Qiuxu Zhuo 2021-06-11  238  				i10nm_printk(KERN_ERR, "Failed to ioremap for hbm mc 0x%llx\n",
c945088384d00e Qiuxu Zhuo 2021-06-11  239  					     base + off);
c945088384d00e Qiuxu Zhuo 2021-06-11  240  				return -ENOMEM;
c945088384d00e Qiuxu Zhuo 2021-06-11  241  			}
c945088384d00e Qiuxu Zhuo 2021-06-11  242  
c945088384d00e Qiuxu Zhuo 2021-06-11  243  			d->imc[lmc].mbase = mbase;
c945088384d00e Qiuxu Zhuo 2021-06-11  244  			d->imc[lmc].hbm_mc = true;
c945088384d00e Qiuxu Zhuo 2021-06-11  245  
c945088384d00e Qiuxu Zhuo 2021-06-11  246  			mcmtr = I10NM_GET_MCMTR(&d->imc[lmc], 0);
c945088384d00e Qiuxu Zhuo 2021-06-11  247  			if (!I10NM_IS_HBM_IMC(mcmtr)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  248  				i10nm_printk(KERN_ERR, "This isn't an hbm mc!\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  249  				return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  250  			}
c945088384d00e Qiuxu Zhuo 2021-06-11  251  
c945088384d00e Qiuxu Zhuo 2021-06-11  252  			lmc++;
c945088384d00e Qiuxu Zhuo 2021-06-11  253  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  254  	}
c945088384d00e Qiuxu Zhuo 2021-06-11  255  
c945088384d00e Qiuxu Zhuo 2021-06-11 @256  	return 0;
c945088384d00e Qiuxu Zhuo 2021-06-11  257  }
c945088384d00e Qiuxu Zhuo 2021-06-11  258  

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

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: drivers/edac/i10nm_base.c:256 i10nm_get_hbm_munits() warn: 'mbase' not released on lines: 249.
Date: Fri, 17 Dec 2021 10:20:18 +0300	[thread overview]
Message-ID: <202112161000.15tF7PTx-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2b14864acbaaf03d9c01982e243a84632524c3ac
commit: c945088384d00e6eb61535cc4ba25bc062090909 EDAC/i10nm: Add support for high bandwidth memory
config: x86_64-randconfig-m001-20211215 (https://download.01.org/0day-ci/archive/20211216/202112161000.15tF7PTx-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 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>

smatch warnings:
drivers/edac/i10nm_base.c:256 i10nm_get_hbm_munits() warn: 'mbase' not released on lines: 249.

vim +/mbase +256 drivers/edac/i10nm_base.c

c945088384d00e Qiuxu Zhuo 2021-06-11  187  static int i10nm_get_hbm_munits(void)
c945088384d00e Qiuxu Zhuo 2021-06-11  188  {
c945088384d00e Qiuxu Zhuo 2021-06-11  189  	struct pci_dev *mdev;
c945088384d00e Qiuxu Zhuo 2021-06-11  190  	void __iomem *mbase;
c945088384d00e Qiuxu Zhuo 2021-06-11  191  	u32 reg, off, mcmtr;
c945088384d00e Qiuxu Zhuo 2021-06-11  192  	struct skx_dev *d;
c945088384d00e Qiuxu Zhuo 2021-06-11  193  	int i, lmc;
c945088384d00e Qiuxu Zhuo 2021-06-11  194  	u64 base;
c945088384d00e Qiuxu Zhuo 2021-06-11  195  
c945088384d00e Qiuxu Zhuo 2021-06-11  196  	list_for_each_entry(d, i10nm_edac_list, list) {
c945088384d00e Qiuxu Zhuo 2021-06-11  197  		d->pcu_cr3 = pci_get_dev_wrapper(d->seg, d->bus[1], 30, 3);
c945088384d00e Qiuxu Zhuo 2021-06-11  198  		if (!d->pcu_cr3)
c945088384d00e Qiuxu Zhuo 2021-06-11  199  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  200  
c945088384d00e Qiuxu Zhuo 2021-06-11  201  		if (!i10nm_check_hbm_imc(d)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  202  			i10nm_printk(KERN_DEBUG, "No hbm memory\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  203  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  204  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  205  
c945088384d00e Qiuxu Zhuo 2021-06-11  206  		if (I10NM_GET_SCK_BAR(d, reg)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  207  			i10nm_printk(KERN_ERR, "Failed to get socket bar\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  208  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  209  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  210  		base = I10NM_GET_SCK_MMIO_BASE(reg);
c945088384d00e Qiuxu Zhuo 2021-06-11  211  
c945088384d00e Qiuxu Zhuo 2021-06-11  212  		if (I10NM_GET_HBM_IMC_BAR(d, reg)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  213  			i10nm_printk(KERN_ERR, "Failed to get hbm mc bar\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  214  			return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  215  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  216  		base += I10NM_GET_HBM_IMC_MMIO_OFFSET(reg);
c945088384d00e Qiuxu Zhuo 2021-06-11  217  
c945088384d00e Qiuxu Zhuo 2021-06-11  218  		lmc = I10NM_NUM_DDR_IMC;
c945088384d00e Qiuxu Zhuo 2021-06-11  219  
c945088384d00e Qiuxu Zhuo 2021-06-11  220  		for (i = 0; i < I10NM_NUM_HBM_IMC; i++) {
c945088384d00e Qiuxu Zhuo 2021-06-11  221  			mdev = pci_get_dev_wrapper(d->seg, d->bus[0],
c945088384d00e Qiuxu Zhuo 2021-06-11  222  						   12 + i / 4, 1 + i % 4);
c945088384d00e Qiuxu Zhuo 2021-06-11  223  			if (i == 0 && !mdev) {
c945088384d00e Qiuxu Zhuo 2021-06-11  224  				i10nm_printk(KERN_ERR, "No hbm mc found\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  225  				return -ENODEV;
c945088384d00e Qiuxu Zhuo 2021-06-11  226  			}
c945088384d00e Qiuxu Zhuo 2021-06-11  227  			if (!mdev)
c945088384d00e Qiuxu Zhuo 2021-06-11  228  				continue;
c945088384d00e Qiuxu Zhuo 2021-06-11  229  
c945088384d00e Qiuxu Zhuo 2021-06-11  230  			d->imc[lmc].mdev = mdev;
c945088384d00e Qiuxu Zhuo 2021-06-11  231  			off = i * I10NM_HBM_IMC_MMIO_SIZE;
c945088384d00e Qiuxu Zhuo 2021-06-11  232  
c945088384d00e Qiuxu Zhuo 2021-06-11  233  			edac_dbg(2, "hbm mc%d mmio base 0x%llx size 0x%x\n",
c945088384d00e Qiuxu Zhuo 2021-06-11  234  				 lmc, base + off, I10NM_HBM_IMC_MMIO_SIZE);
c945088384d00e Qiuxu Zhuo 2021-06-11  235  
c945088384d00e Qiuxu Zhuo 2021-06-11  236  			mbase = ioremap(base + off, I10NM_HBM_IMC_MMIO_SIZE);
                                                                ^^^^^^^^^^^^^^^^

c945088384d00e Qiuxu Zhuo 2021-06-11  237  			if (!mbase) {
c945088384d00e Qiuxu Zhuo 2021-06-11  238  				i10nm_printk(KERN_ERR, "Failed to ioremap for hbm mc 0x%llx\n",
c945088384d00e Qiuxu Zhuo 2021-06-11  239  					     base + off);
c945088384d00e Qiuxu Zhuo 2021-06-11  240  				return -ENOMEM;
c945088384d00e Qiuxu Zhuo 2021-06-11  241  			}
c945088384d00e Qiuxu Zhuo 2021-06-11  242  
c945088384d00e Qiuxu Zhuo 2021-06-11  243  			d->imc[lmc].mbase = mbase;
c945088384d00e Qiuxu Zhuo 2021-06-11  244  			d->imc[lmc].hbm_mc = true;
c945088384d00e Qiuxu Zhuo 2021-06-11  245  
c945088384d00e Qiuxu Zhuo 2021-06-11  246  			mcmtr = I10NM_GET_MCMTR(&d->imc[lmc], 0);
c945088384d00e Qiuxu Zhuo 2021-06-11  247  			if (!I10NM_IS_HBM_IMC(mcmtr)) {
c945088384d00e Qiuxu Zhuo 2021-06-11  248  				i10nm_printk(KERN_ERR, "This isn't an hbm mc!\n");
c945088384d00e Qiuxu Zhuo 2021-06-11  249  				return -ENODEV;

No clean up before the return.

c945088384d00e Qiuxu Zhuo 2021-06-11  250  			}
c945088384d00e Qiuxu Zhuo 2021-06-11  251  
c945088384d00e Qiuxu Zhuo 2021-06-11  252  			lmc++;
c945088384d00e Qiuxu Zhuo 2021-06-11  253  		}
c945088384d00e Qiuxu Zhuo 2021-06-11  254  	}
c945088384d00e Qiuxu Zhuo 2021-06-11  255  
c945088384d00e Qiuxu Zhuo 2021-06-11 @256  	return 0;
c945088384d00e Qiuxu Zhuo 2021-06-11  257  }

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

             reply	other threads:[~2021-12-17  7:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16  2:01 kernel test robot [this message]
2021-12-17  7:20 ` drivers/edac/i10nm_base.c:256 i10nm_get_hbm_munits() warn: 'mbase' not released on lines: 249 Dan Carpenter
2021-12-17  7:20 ` Dan Carpenter
2021-12-17 13:29 ` Zhuo, Qiuxu
2021-12-17 13:29   ` Zhuo, Qiuxu
2021-12-24  9:11 ` [PATCH 1/1] EDAC/i10nm: Release mdev/mbase when failing to detect HBM Qiuxu Zhuo
2022-01-11  5:25 drivers/edac/i10nm_base.c:256 i10nm_get_hbm_munits() warn: 'mbase' not released on lines: 249 Dan Carpenter
2022-01-10 20:21 ` kernel test robot
2022-01-11  5:25 ` Dan Carpenter

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=202112161000.15tF7PTx-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=qiuxu.zhuo@intel.com \
    --cc=tony.luck@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.