All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy
@ 2021-06-22 14:22 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-06-22 14:12 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Oliver O'Halloran" <oohall@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Alexey Kardashevskiy <aik@ozlabs.ru>
CC: Frederic Barrat <fbarrat@linux.ibm.com>
CC: "Cédric Le Goater" <clg@kaod.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a96bfed64c8986d6404e553f18203cae1f5ac7e6
commit: 450be4960a0fb89b931a6bb3c3f0bb538ac4c03c powerpc/pci: Remove LSI mappings on device teardown
date:   7 months ago
:::::: branch date: 21 hours ago
:::::: commit date: 7 months ago
config: powerpc64-randconfig-m031-20210622 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 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:
arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy

vim +418 arch/powerpc/kernel/pci-common.c

450be4960a0fb8 Oliver O'Halloran      2020-12-02  404  
58083dade53cd4 Kumar Gala             2007-06-27  405  /*
58083dade53cd4 Kumar Gala             2007-06-27  406   * Reads the interrupt pin to determine if interrupt is use by card.
58083dade53cd4 Kumar Gala             2007-06-27  407   * If the interrupt is used, then gets the interrupt line from the
58083dade53cd4 Kumar Gala             2007-06-27  408   * openfirmware and sets it in the pci_dev and pci_config line.
58083dade53cd4 Kumar Gala             2007-06-27  409   */
4666ca2aa34410 Benjamin Herrenschmidt 2011-11-29  410  static int pci_read_irq_line(struct pci_dev *pci_dev)
58083dade53cd4 Kumar Gala             2007-06-27  411  {
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  412  	int virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  413  	struct pci_intx_virq *vi, *vitmp;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  414  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  415  	/* Preallocate vi as rewind is complex if this fails after mapping */
450be4960a0fb8 Oliver O'Halloran      2020-12-02  416  	vi = kzalloc(sizeof(struct pci_intx_virq), GFP_KERNEL);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  417  	if (!vi)
450be4960a0fb8 Oliver O'Halloran      2020-12-02 @418  		return -1;
58083dade53cd4 Kumar Gala             2007-06-27  419  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  420  	pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
58083dade53cd4 Kumar Gala             2007-06-27  421  
58083dade53cd4 Kumar Gala             2007-06-27  422  	/* Try to get a mapping from the device-tree */
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  423  	virq = of_irq_parse_and_map_pci(pci_dev, 0, 0);
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  424  	if (virq <= 0) {
58083dade53cd4 Kumar Gala             2007-06-27  425  		u8 line, pin;
58083dade53cd4 Kumar Gala             2007-06-27  426  
58083dade53cd4 Kumar Gala             2007-06-27  427  		/* If that fails, lets fallback to what is in the config
58083dade53cd4 Kumar Gala             2007-06-27  428  		 * space and map that through the default controller. We
58083dade53cd4 Kumar Gala             2007-06-27  429  		 * also set the type to level low since that's what PCI
58083dade53cd4 Kumar Gala             2007-06-27  430  		 * interrupts are. If your platform does differently, then
58083dade53cd4 Kumar Gala             2007-06-27  431  		 * either provide a proper interrupt tree or don't use this
58083dade53cd4 Kumar Gala             2007-06-27  432  		 * function.
58083dade53cd4 Kumar Gala             2007-06-27  433  		 */
58083dade53cd4 Kumar Gala             2007-06-27  434  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
450be4960a0fb8 Oliver O'Halloran      2020-12-02  435  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  436  		if (pin == 0)
450be4960a0fb8 Oliver O'Halloran      2020-12-02  437  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  438  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  439  		    line == 0xff || line == 0) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  440  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  441  		}
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  442  		pr_debug(" No map ! Using line %d (pin %d) from PCI config\n",
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  443  			 line, pin);
58083dade53cd4 Kumar Gala             2007-06-27  444  
58083dade53cd4 Kumar Gala             2007-06-27  445  		virq = irq_create_mapping(NULL, line);
ef24ba7091517d Michael Ellerman       2016-09-06  446  		if (virq)
ec775d0e70eb6b Thomas Gleixner        2011-03-25  447  			irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
58083dade53cd4 Kumar Gala             2007-06-27  448  	}
ef24ba7091517d Michael Ellerman       2016-09-06  449  
ef24ba7091517d Michael Ellerman       2016-09-06  450  	if (!virq) {
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  451  		pr_debug(" Failed to map !\n");
450be4960a0fb8 Oliver O'Halloran      2020-12-02  452  		goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  453  	}
58083dade53cd4 Kumar Gala             2007-06-27  454  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  455  	pr_debug(" Mapped to linux irq %d\n", virq);
58083dade53cd4 Kumar Gala             2007-06-27  456  
58083dade53cd4 Kumar Gala             2007-06-27  457  	pci_dev->irq = virq;
58083dade53cd4 Kumar Gala             2007-06-27  458  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  459  	mutex_lock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  460  	list_for_each_entry(vitmp, &intx_list, list_node) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  461  		if (vitmp->virq == virq) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  462  			kref_get(&vitmp->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  463  			kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  464  			vi = NULL;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  465  			break;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  466  		}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  467  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  468  	if (vi) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  469  		vi->virq = virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  470  		kref_init(&vi->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  471  		list_add_tail(&vi->list_node, &intx_list);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  472  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  473  	mutex_unlock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  474  
58083dade53cd4 Kumar Gala             2007-06-27  475  	return 0;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  476  error_exit:
450be4960a0fb8 Oliver O'Halloran      2020-12-02  477  	kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  478  	return -1;
58083dade53cd4 Kumar Gala             2007-06-27  479  }
58083dade53cd4 Kumar Gala             2007-06-27  480  

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

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy
@ 2021-06-22 14:22 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2021-06-22 14:22 UTC (permalink / raw)
  To: kbuild, Oliver O'Halloran
  Cc: lkp, kbuild-all, linux-kernel, Michael Ellerman,
	Alexey Kardashevskiy, Frederic Barrat, Cédric Le Goater

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a96bfed64c8986d6404e553f18203cae1f5ac7e6
commit: 450be4960a0fb89b931a6bb3c3f0bb538ac4c03c powerpc/pci: Remove LSI mappings on device teardown
config: powerpc64-randconfig-m031-20210622 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 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:
arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy

vim +418 arch/powerpc/kernel/pci-common.c

4666ca2aa34410 Benjamin Herrenschmidt 2011-11-29  410  static int pci_read_irq_line(struct pci_dev *pci_dev)
58083dade53cd4 Kumar Gala             2007-06-27  411  {
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  412  	int virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  413  	struct pci_intx_virq *vi, *vitmp;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  414  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  415  	/* Preallocate vi as rewind is complex if this fails after mapping */
450be4960a0fb8 Oliver O'Halloran      2020-12-02  416  	vi = kzalloc(sizeof(struct pci_intx_virq), GFP_KERNEL);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  417  	if (!vi)
450be4960a0fb8 Oliver O'Halloran      2020-12-02 @418  		return -1;

-ENOMEM;

58083dade53cd4 Kumar Gala             2007-06-27  419  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  420  	pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
58083dade53cd4 Kumar Gala             2007-06-27  421  
58083dade53cd4 Kumar Gala             2007-06-27  422  	/* Try to get a mapping from the device-tree */
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  423  	virq = of_irq_parse_and_map_pci(pci_dev, 0, 0);
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  424  	if (virq <= 0) {
58083dade53cd4 Kumar Gala             2007-06-27  425  		u8 line, pin;
58083dade53cd4 Kumar Gala             2007-06-27  426  
58083dade53cd4 Kumar Gala             2007-06-27  427  		/* If that fails, lets fallback to what is in the config
58083dade53cd4 Kumar Gala             2007-06-27  428  		 * space and map that through the default controller. We
58083dade53cd4 Kumar Gala             2007-06-27  429  		 * also set the type to level low since that's what PCI
58083dade53cd4 Kumar Gala             2007-06-27  430  		 * interrupts are. If your platform does differently, then
58083dade53cd4 Kumar Gala             2007-06-27  431  		 * either provide a proper interrupt tree or don't use this
58083dade53cd4 Kumar Gala             2007-06-27  432  		 * function.
58083dade53cd4 Kumar Gala             2007-06-27  433  		 */
58083dade53cd4 Kumar Gala             2007-06-27  434  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
450be4960a0fb8 Oliver O'Halloran      2020-12-02  435  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  436  		if (pin == 0)
450be4960a0fb8 Oliver O'Halloran      2020-12-02  437  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  438  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  439  		    line == 0xff || line == 0) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  440  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  441  		}
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  442  		pr_debug(" No map ! Using line %d (pin %d) from PCI config\n",
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  443  			 line, pin);
58083dade53cd4 Kumar Gala             2007-06-27  444  
58083dade53cd4 Kumar Gala             2007-06-27  445  		virq = irq_create_mapping(NULL, line);
ef24ba7091517d Michael Ellerman       2016-09-06  446  		if (virq)
ec775d0e70eb6b Thomas Gleixner        2011-03-25  447  			irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
58083dade53cd4 Kumar Gala             2007-06-27  448  	}
ef24ba7091517d Michael Ellerman       2016-09-06  449  
ef24ba7091517d Michael Ellerman       2016-09-06  450  	if (!virq) {
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  451  		pr_debug(" Failed to map !\n");
450be4960a0fb8 Oliver O'Halloran      2020-12-02  452  		goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  453  	}
58083dade53cd4 Kumar Gala             2007-06-27  454  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  455  	pr_debug(" Mapped to linux irq %d\n", virq);
58083dade53cd4 Kumar Gala             2007-06-27  456  
58083dade53cd4 Kumar Gala             2007-06-27  457  	pci_dev->irq = virq;
58083dade53cd4 Kumar Gala             2007-06-27  458  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  459  	mutex_lock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  460  	list_for_each_entry(vitmp, &intx_list, list_node) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  461  		if (vitmp->virq == virq) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  462  			kref_get(&vitmp->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  463  			kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  464  			vi = NULL;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  465  			break;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  466  		}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  467  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  468  	if (vi) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  469  		vi->virq = virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  470  		kref_init(&vi->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  471  		list_add_tail(&vi->list_node, &intx_list);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  472  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  473  	mutex_unlock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  474  
58083dade53cd4 Kumar Gala             2007-06-27  475  	return 0;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  476  error_exit:
450be4960a0fb8 Oliver O'Halloran      2020-12-02  477  	kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  478  	return -1;
58083dade53cd4 Kumar Gala             2007-06-27  479  }

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy
@ 2021-06-22 14:22 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2021-06-22 14:22 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a96bfed64c8986d6404e553f18203cae1f5ac7e6
commit: 450be4960a0fb89b931a6bb3c3f0bb538ac4c03c powerpc/pci: Remove LSI mappings on device teardown
config: powerpc64-randconfig-m031-20210622 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 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:
arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy

vim +418 arch/powerpc/kernel/pci-common.c

4666ca2aa34410 Benjamin Herrenschmidt 2011-11-29  410  static int pci_read_irq_line(struct pci_dev *pci_dev)
58083dade53cd4 Kumar Gala             2007-06-27  411  {
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  412  	int virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  413  	struct pci_intx_virq *vi, *vitmp;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  414  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  415  	/* Preallocate vi as rewind is complex if this fails after mapping */
450be4960a0fb8 Oliver O'Halloran      2020-12-02  416  	vi = kzalloc(sizeof(struct pci_intx_virq), GFP_KERNEL);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  417  	if (!vi)
450be4960a0fb8 Oliver O'Halloran      2020-12-02 @418  		return -1;

-ENOMEM;

58083dade53cd4 Kumar Gala             2007-06-27  419  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  420  	pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
58083dade53cd4 Kumar Gala             2007-06-27  421  
58083dade53cd4 Kumar Gala             2007-06-27  422  	/* Try to get a mapping from the device-tree */
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  423  	virq = of_irq_parse_and_map_pci(pci_dev, 0, 0);
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  424  	if (virq <= 0) {
58083dade53cd4 Kumar Gala             2007-06-27  425  		u8 line, pin;
58083dade53cd4 Kumar Gala             2007-06-27  426  
58083dade53cd4 Kumar Gala             2007-06-27  427  		/* If that fails, lets fallback to what is in the config
58083dade53cd4 Kumar Gala             2007-06-27  428  		 * space and map that through the default controller. We
58083dade53cd4 Kumar Gala             2007-06-27  429  		 * also set the type to level low since that's what PCI
58083dade53cd4 Kumar Gala             2007-06-27  430  		 * interrupts are. If your platform does differently, then
58083dade53cd4 Kumar Gala             2007-06-27  431  		 * either provide a proper interrupt tree or don't use this
58083dade53cd4 Kumar Gala             2007-06-27  432  		 * function.
58083dade53cd4 Kumar Gala             2007-06-27  433  		 */
58083dade53cd4 Kumar Gala             2007-06-27  434  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
450be4960a0fb8 Oliver O'Halloran      2020-12-02  435  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  436  		if (pin == 0)
450be4960a0fb8 Oliver O'Halloran      2020-12-02  437  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  438  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  439  		    line == 0xff || line == 0) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  440  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  441  		}
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  442  		pr_debug(" No map ! Using line %d (pin %d) from PCI config\n",
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  443  			 line, pin);
58083dade53cd4 Kumar Gala             2007-06-27  444  
58083dade53cd4 Kumar Gala             2007-06-27  445  		virq = irq_create_mapping(NULL, line);
ef24ba7091517d Michael Ellerman       2016-09-06  446  		if (virq)
ec775d0e70eb6b Thomas Gleixner        2011-03-25  447  			irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
58083dade53cd4 Kumar Gala             2007-06-27  448  	}
ef24ba7091517d Michael Ellerman       2016-09-06  449  
ef24ba7091517d Michael Ellerman       2016-09-06  450  	if (!virq) {
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  451  		pr_debug(" Failed to map !\n");
450be4960a0fb8 Oliver O'Halloran      2020-12-02  452  		goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  453  	}
58083dade53cd4 Kumar Gala             2007-06-27  454  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  455  	pr_debug(" Mapped to linux irq %d\n", virq);
58083dade53cd4 Kumar Gala             2007-06-27  456  
58083dade53cd4 Kumar Gala             2007-06-27  457  	pci_dev->irq = virq;
58083dade53cd4 Kumar Gala             2007-06-27  458  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  459  	mutex_lock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  460  	list_for_each_entry(vitmp, &intx_list, list_node) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  461  		if (vitmp->virq == virq) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  462  			kref_get(&vitmp->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  463  			kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  464  			vi = NULL;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  465  			break;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  466  		}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  467  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  468  	if (vi) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  469  		vi->virq = virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  470  		kref_init(&vi->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  471  		list_add_tail(&vi->list_node, &intx_list);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  472  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  473  	mutex_unlock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  474  
58083dade53cd4 Kumar Gala             2007-06-27  475  	return 0;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  476  error_exit:
450be4960a0fb8 Oliver O'Halloran      2020-12-02  477  	kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  478  	return -1;
58083dade53cd4 Kumar Gala             2007-06-27  479  }

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy
@ 2021-11-17 12:04 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-11-17 12:04 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Oliver O'Halloran" <oohall@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Alexey Kardashevskiy <aik@ozlabs.ru>
CC: Frederic Barrat <fbarrat@linux.ibm.com>
CC: "Cédric Le Goater" <clg@kaod.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8ab774587903771821b59471cc723bba6d893942
commit: 450be4960a0fb89b931a6bb3c3f0bb538ac4c03c powerpc/pci: Remove LSI mappings on device teardown
date:   12 months ago
:::::: branch date: 2 days ago
:::::: commit date: 12 months ago
config: powerpc-randconfig-m031-20211117 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 11.2.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:
arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy

vim +418 arch/powerpc/kernel/pci-common.c

450be4960a0fb89 Oliver O'Halloran      2020-12-02  404  
58083dade53cd43 Kumar Gala             2007-06-27  405  /*
58083dade53cd43 Kumar Gala             2007-06-27  406   * Reads the interrupt pin to determine if interrupt is use by card.
58083dade53cd43 Kumar Gala             2007-06-27  407   * If the interrupt is used, then gets the interrupt line from the
58083dade53cd43 Kumar Gala             2007-06-27  408   * openfirmware and sets it in the pci_dev and pci_config line.
58083dade53cd43 Kumar Gala             2007-06-27  409   */
4666ca2aa344105 Benjamin Herrenschmidt 2011-11-29  410  static int pci_read_irq_line(struct pci_dev *pci_dev)
58083dade53cd43 Kumar Gala             2007-06-27  411  {
c591c2e36ccc9a0 Alexey Kardashevskiy   2018-02-09  412  	int virq;
450be4960a0fb89 Oliver O'Halloran      2020-12-02  413  	struct pci_intx_virq *vi, *vitmp;
450be4960a0fb89 Oliver O'Halloran      2020-12-02  414  
450be4960a0fb89 Oliver O'Halloran      2020-12-02  415  	/* Preallocate vi as rewind is complex if this fails after mapping */
450be4960a0fb89 Oliver O'Halloran      2020-12-02  416  	vi = kzalloc(sizeof(struct pci_intx_virq), GFP_KERNEL);
450be4960a0fb89 Oliver O'Halloran      2020-12-02  417  	if (!vi)
450be4960a0fb89 Oliver O'Halloran      2020-12-02 @418  		return -1;
58083dade53cd43 Kumar Gala             2007-06-27  419  
b0494bc8ee449f0 Benjamin Herrenschmidt 2008-10-27  420  	pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
58083dade53cd43 Kumar Gala             2007-06-27  421  
58083dade53cd43 Kumar Gala             2007-06-27  422  	/* Try to get a mapping from the device-tree */
c591c2e36ccc9a0 Alexey Kardashevskiy   2018-02-09  423  	virq = of_irq_parse_and_map_pci(pci_dev, 0, 0);
c591c2e36ccc9a0 Alexey Kardashevskiy   2018-02-09  424  	if (virq <= 0) {
58083dade53cd43 Kumar Gala             2007-06-27  425  		u8 line, pin;
58083dade53cd43 Kumar Gala             2007-06-27  426  
58083dade53cd43 Kumar Gala             2007-06-27  427  		/* If that fails, lets fallback to what is in the config
58083dade53cd43 Kumar Gala             2007-06-27  428  		 * space and map that through the default controller. We
58083dade53cd43 Kumar Gala             2007-06-27  429  		 * also set the type to level low since that's what PCI
58083dade53cd43 Kumar Gala             2007-06-27  430  		 * interrupts are. If your platform does differently, then
58083dade53cd43 Kumar Gala             2007-06-27  431  		 * either provide a proper interrupt tree or don't use this
58083dade53cd43 Kumar Gala             2007-06-27  432  		 * function.
58083dade53cd43 Kumar Gala             2007-06-27  433  		 */
58083dade53cd43 Kumar Gala             2007-06-27  434  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
450be4960a0fb89 Oliver O'Halloran      2020-12-02  435  			goto error_exit;
58083dade53cd43 Kumar Gala             2007-06-27  436  		if (pin == 0)
450be4960a0fb89 Oliver O'Halloran      2020-12-02  437  			goto error_exit;
58083dade53cd43 Kumar Gala             2007-06-27  438  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
54a24cbbd0184fa Benjamin Herrenschmidt 2007-12-20  439  		    line == 0xff || line == 0) {
450be4960a0fb89 Oliver O'Halloran      2020-12-02  440  			goto error_exit;
58083dade53cd43 Kumar Gala             2007-06-27  441  		}
b0494bc8ee449f0 Benjamin Herrenschmidt 2008-10-27  442  		pr_debug(" No map ! Using line %d (pin %d) from PCI config\n",
54a24cbbd0184fa Benjamin Herrenschmidt 2007-12-20  443  			 line, pin);
58083dade53cd43 Kumar Gala             2007-06-27  444  
58083dade53cd43 Kumar Gala             2007-06-27  445  		virq = irq_create_mapping(NULL, line);
ef24ba7091517d2 Michael Ellerman       2016-09-06  446  		if (virq)
ec775d0e70eb6b7 Thomas Gleixner        2011-03-25  447  			irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
58083dade53cd43 Kumar Gala             2007-06-27  448  	}
ef24ba7091517d2 Michael Ellerman       2016-09-06  449  
ef24ba7091517d2 Michael Ellerman       2016-09-06  450  	if (!virq) {
b0494bc8ee449f0 Benjamin Herrenschmidt 2008-10-27  451  		pr_debug(" Failed to map !\n");
450be4960a0fb89 Oliver O'Halloran      2020-12-02  452  		goto error_exit;
58083dade53cd43 Kumar Gala             2007-06-27  453  	}
58083dade53cd43 Kumar Gala             2007-06-27  454  
b0494bc8ee449f0 Benjamin Herrenschmidt 2008-10-27  455  	pr_debug(" Mapped to linux irq %d\n", virq);
58083dade53cd43 Kumar Gala             2007-06-27  456  
58083dade53cd43 Kumar Gala             2007-06-27  457  	pci_dev->irq = virq;
58083dade53cd43 Kumar Gala             2007-06-27  458  
450be4960a0fb89 Oliver O'Halloran      2020-12-02  459  	mutex_lock(&intx_mutex);
450be4960a0fb89 Oliver O'Halloran      2020-12-02  460  	list_for_each_entry(vitmp, &intx_list, list_node) {
450be4960a0fb89 Oliver O'Halloran      2020-12-02  461  		if (vitmp->virq == virq) {
450be4960a0fb89 Oliver O'Halloran      2020-12-02  462  			kref_get(&vitmp->kref);
450be4960a0fb89 Oliver O'Halloran      2020-12-02  463  			kfree(vi);
450be4960a0fb89 Oliver O'Halloran      2020-12-02  464  			vi = NULL;
450be4960a0fb89 Oliver O'Halloran      2020-12-02  465  			break;
450be4960a0fb89 Oliver O'Halloran      2020-12-02  466  		}
450be4960a0fb89 Oliver O'Halloran      2020-12-02  467  	}
450be4960a0fb89 Oliver O'Halloran      2020-12-02  468  	if (vi) {
450be4960a0fb89 Oliver O'Halloran      2020-12-02  469  		vi->virq = virq;
450be4960a0fb89 Oliver O'Halloran      2020-12-02  470  		kref_init(&vi->kref);
450be4960a0fb89 Oliver O'Halloran      2020-12-02  471  		list_add_tail(&vi->list_node, &intx_list);
450be4960a0fb89 Oliver O'Halloran      2020-12-02  472  	}
450be4960a0fb89 Oliver O'Halloran      2020-12-02  473  	mutex_unlock(&intx_mutex);
450be4960a0fb89 Oliver O'Halloran      2020-12-02  474  
58083dade53cd43 Kumar Gala             2007-06-27  475  	return 0;
450be4960a0fb89 Oliver O'Halloran      2020-12-02  476  error_exit:
450be4960a0fb89 Oliver O'Halloran      2020-12-02  477  	kfree(vi);
450be4960a0fb89 Oliver O'Halloran      2020-12-02  478  	return -1;
58083dade53cd43 Kumar Gala             2007-06-27  479  }
58083dade53cd43 Kumar Gala             2007-06-27  480  

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

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy
@ 2021-11-14  2:27 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-11-14  2:27 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Oliver O'Halloran" <oohall@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Alexey Kardashevskiy <aik@ozlabs.ru>
CC: Frederic Barrat <fbarrat@linux.ibm.com>
CC: "Cédric Le Goater" <clg@kaod.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c8c109546a19613d323a319d0c921cb1f317e629
commit: 450be4960a0fb89b931a6bb3c3f0bb538ac4c03c powerpc/pci: Remove LSI mappings on device teardown
date:   12 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 12 months ago
config: powerpc64-randconfig-m031-20211020 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 11.2.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:
arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy

vim +418 arch/powerpc/kernel/pci-common.c

450be4960a0fb8 Oliver O'Halloran      2020-12-02  404  
58083dade53cd4 Kumar Gala             2007-06-27  405  /*
58083dade53cd4 Kumar Gala             2007-06-27  406   * Reads the interrupt pin to determine if interrupt is use by card.
58083dade53cd4 Kumar Gala             2007-06-27  407   * If the interrupt is used, then gets the interrupt line from the
58083dade53cd4 Kumar Gala             2007-06-27  408   * openfirmware and sets it in the pci_dev and pci_config line.
58083dade53cd4 Kumar Gala             2007-06-27  409   */
4666ca2aa34410 Benjamin Herrenschmidt 2011-11-29  410  static int pci_read_irq_line(struct pci_dev *pci_dev)
58083dade53cd4 Kumar Gala             2007-06-27  411  {
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  412  	int virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  413  	struct pci_intx_virq *vi, *vitmp;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  414  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  415  	/* Preallocate vi as rewind is complex if this fails after mapping */
450be4960a0fb8 Oliver O'Halloran      2020-12-02  416  	vi = kzalloc(sizeof(struct pci_intx_virq), GFP_KERNEL);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  417  	if (!vi)
450be4960a0fb8 Oliver O'Halloran      2020-12-02 @418  		return -1;
58083dade53cd4 Kumar Gala             2007-06-27  419  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  420  	pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
58083dade53cd4 Kumar Gala             2007-06-27  421  
58083dade53cd4 Kumar Gala             2007-06-27  422  	/* Try to get a mapping from the device-tree */
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  423  	virq = of_irq_parse_and_map_pci(pci_dev, 0, 0);
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  424  	if (virq <= 0) {
58083dade53cd4 Kumar Gala             2007-06-27  425  		u8 line, pin;
58083dade53cd4 Kumar Gala             2007-06-27  426  
58083dade53cd4 Kumar Gala             2007-06-27  427  		/* If that fails, lets fallback to what is in the config
58083dade53cd4 Kumar Gala             2007-06-27  428  		 * space and map that through the default controller. We
58083dade53cd4 Kumar Gala             2007-06-27  429  		 * also set the type to level low since that's what PCI
58083dade53cd4 Kumar Gala             2007-06-27  430  		 * interrupts are. If your platform does differently, then
58083dade53cd4 Kumar Gala             2007-06-27  431  		 * either provide a proper interrupt tree or don't use this
58083dade53cd4 Kumar Gala             2007-06-27  432  		 * function.
58083dade53cd4 Kumar Gala             2007-06-27  433  		 */
58083dade53cd4 Kumar Gala             2007-06-27  434  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
450be4960a0fb8 Oliver O'Halloran      2020-12-02  435  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  436  		if (pin == 0)
450be4960a0fb8 Oliver O'Halloran      2020-12-02  437  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  438  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  439  		    line == 0xff || line == 0) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  440  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  441  		}
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  442  		pr_debug(" No map ! Using line %d (pin %d) from PCI config\n",
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  443  			 line, pin);
58083dade53cd4 Kumar Gala             2007-06-27  444  
58083dade53cd4 Kumar Gala             2007-06-27  445  		virq = irq_create_mapping(NULL, line);
ef24ba7091517d Michael Ellerman       2016-09-06  446  		if (virq)
ec775d0e70eb6b Thomas Gleixner        2011-03-25  447  			irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
58083dade53cd4 Kumar Gala             2007-06-27  448  	}
ef24ba7091517d Michael Ellerman       2016-09-06  449  
ef24ba7091517d Michael Ellerman       2016-09-06  450  	if (!virq) {
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  451  		pr_debug(" Failed to map !\n");
450be4960a0fb8 Oliver O'Halloran      2020-12-02  452  		goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  453  	}
58083dade53cd4 Kumar Gala             2007-06-27  454  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  455  	pr_debug(" Mapped to linux irq %d\n", virq);
58083dade53cd4 Kumar Gala             2007-06-27  456  
58083dade53cd4 Kumar Gala             2007-06-27  457  	pci_dev->irq = virq;
58083dade53cd4 Kumar Gala             2007-06-27  458  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  459  	mutex_lock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  460  	list_for_each_entry(vitmp, &intx_list, list_node) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  461  		if (vitmp->virq == virq) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  462  			kref_get(&vitmp->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  463  			kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  464  			vi = NULL;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  465  			break;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  466  		}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  467  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  468  	if (vi) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  469  		vi->virq = virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  470  		kref_init(&vi->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  471  		list_add_tail(&vi->list_node, &intx_list);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  472  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  473  	mutex_unlock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  474  
58083dade53cd4 Kumar Gala             2007-06-27  475  	return 0;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  476  error_exit:
450be4960a0fb8 Oliver O'Halloran      2020-12-02  477  	kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  478  	return -1;
58083dade53cd4 Kumar Gala             2007-06-27  479  }
58083dade53cd4 Kumar Gala             2007-06-27  480  

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

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy
@ 2021-11-12 21:22 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-11-12 21:22 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Oliver O'Halloran" <oohall@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Alexey Kardashevskiy <aik@ozlabs.ru>
CC: Frederic Barrat <fbarrat@linux.ibm.com>
CC: "Cédric Le Goater" <clg@kaod.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5833291ab6de9c3e2374336b51c814e515e8f3a5
commit: 450be4960a0fb89b931a6bb3c3f0bb538ac4c03c powerpc/pci: Remove LSI mappings on device teardown
date:   11 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 11 months ago
config: powerpc64-randconfig-m031-20211101 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 11.2.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:
arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy

vim +418 arch/powerpc/kernel/pci-common.c

450be4960a0fb8 Oliver O'Halloran      2020-12-02  404  
58083dade53cd4 Kumar Gala             2007-06-27  405  /*
58083dade53cd4 Kumar Gala             2007-06-27  406   * Reads the interrupt pin to determine if interrupt is use by card.
58083dade53cd4 Kumar Gala             2007-06-27  407   * If the interrupt is used, then gets the interrupt line from the
58083dade53cd4 Kumar Gala             2007-06-27  408   * openfirmware and sets it in the pci_dev and pci_config line.
58083dade53cd4 Kumar Gala             2007-06-27  409   */
4666ca2aa34410 Benjamin Herrenschmidt 2011-11-29  410  static int pci_read_irq_line(struct pci_dev *pci_dev)
58083dade53cd4 Kumar Gala             2007-06-27  411  {
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  412  	int virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  413  	struct pci_intx_virq *vi, *vitmp;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  414  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  415  	/* Preallocate vi as rewind is complex if this fails after mapping */
450be4960a0fb8 Oliver O'Halloran      2020-12-02  416  	vi = kzalloc(sizeof(struct pci_intx_virq), GFP_KERNEL);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  417  	if (!vi)
450be4960a0fb8 Oliver O'Halloran      2020-12-02 @418  		return -1;
58083dade53cd4 Kumar Gala             2007-06-27  419  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  420  	pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
58083dade53cd4 Kumar Gala             2007-06-27  421  
58083dade53cd4 Kumar Gala             2007-06-27  422  	/* Try to get a mapping from the device-tree */
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  423  	virq = of_irq_parse_and_map_pci(pci_dev, 0, 0);
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  424  	if (virq <= 0) {
58083dade53cd4 Kumar Gala             2007-06-27  425  		u8 line, pin;
58083dade53cd4 Kumar Gala             2007-06-27  426  
58083dade53cd4 Kumar Gala             2007-06-27  427  		/* If that fails, lets fallback to what is in the config
58083dade53cd4 Kumar Gala             2007-06-27  428  		 * space and map that through the default controller. We
58083dade53cd4 Kumar Gala             2007-06-27  429  		 * also set the type to level low since that's what PCI
58083dade53cd4 Kumar Gala             2007-06-27  430  		 * interrupts are. If your platform does differently, then
58083dade53cd4 Kumar Gala             2007-06-27  431  		 * either provide a proper interrupt tree or don't use this
58083dade53cd4 Kumar Gala             2007-06-27  432  		 * function.
58083dade53cd4 Kumar Gala             2007-06-27  433  		 */
58083dade53cd4 Kumar Gala             2007-06-27  434  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
450be4960a0fb8 Oliver O'Halloran      2020-12-02  435  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  436  		if (pin == 0)
450be4960a0fb8 Oliver O'Halloran      2020-12-02  437  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  438  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  439  		    line == 0xff || line == 0) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  440  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  441  		}
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  442  		pr_debug(" No map ! Using line %d (pin %d) from PCI config\n",
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  443  			 line, pin);
58083dade53cd4 Kumar Gala             2007-06-27  444  
58083dade53cd4 Kumar Gala             2007-06-27  445  		virq = irq_create_mapping(NULL, line);
ef24ba7091517d Michael Ellerman       2016-09-06  446  		if (virq)
ec775d0e70eb6b Thomas Gleixner        2011-03-25  447  			irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
58083dade53cd4 Kumar Gala             2007-06-27  448  	}
ef24ba7091517d Michael Ellerman       2016-09-06  449  
ef24ba7091517d Michael Ellerman       2016-09-06  450  	if (!virq) {
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  451  		pr_debug(" Failed to map !\n");
450be4960a0fb8 Oliver O'Halloran      2020-12-02  452  		goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  453  	}
58083dade53cd4 Kumar Gala             2007-06-27  454  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  455  	pr_debug(" Mapped to linux irq %d\n", virq);
58083dade53cd4 Kumar Gala             2007-06-27  456  
58083dade53cd4 Kumar Gala             2007-06-27  457  	pci_dev->irq = virq;
58083dade53cd4 Kumar Gala             2007-06-27  458  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  459  	mutex_lock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  460  	list_for_each_entry(vitmp, &intx_list, list_node) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  461  		if (vitmp->virq == virq) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  462  			kref_get(&vitmp->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  463  			kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  464  			vi = NULL;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  465  			break;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  466  		}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  467  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  468  	if (vi) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  469  		vi->virq = virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  470  		kref_init(&vi->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  471  		list_add_tail(&vi->list_node, &intx_list);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  472  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  473  	mutex_unlock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  474  
58083dade53cd4 Kumar Gala             2007-06-27  475  	return 0;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  476  error_exit:
450be4960a0fb8 Oliver O'Halloran      2020-12-02  477  	kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  478  	return -1;
58083dade53cd4 Kumar Gala             2007-06-27  479  }
58083dade53cd4 Kumar Gala             2007-06-27  480  

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

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy
@ 2021-09-10  7:54 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-09-10  7:54 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Oliver O'Halloran" <oohall@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Alexey Kardashevskiy <aik@ozlabs.ru>
CC: Frederic Barrat <fbarrat@linux.ibm.com>
CC: "Cédric Le Goater" <clg@kaod.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   bf9f243f23e6623f310ba03fbb14e10ec3a61290
commit: 450be4960a0fb89b931a6bb3c3f0bb538ac4c03c powerpc/pci: Remove LSI mappings on device teardown
date:   9 months ago
:::::: branch date: 9 hours ago
:::::: commit date: 9 months ago
config: powerpc64-randconfig-m031-20210910 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 11.2.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:
arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy

vim +418 arch/powerpc/kernel/pci-common.c

450be4960a0fb8 Oliver O'Halloran      2020-12-02  404  
58083dade53cd4 Kumar Gala             2007-06-27  405  /*
58083dade53cd4 Kumar Gala             2007-06-27  406   * Reads the interrupt pin to determine if interrupt is use by card.
58083dade53cd4 Kumar Gala             2007-06-27  407   * If the interrupt is used, then gets the interrupt line from the
58083dade53cd4 Kumar Gala             2007-06-27  408   * openfirmware and sets it in the pci_dev and pci_config line.
58083dade53cd4 Kumar Gala             2007-06-27  409   */
4666ca2aa34410 Benjamin Herrenschmidt 2011-11-29  410  static int pci_read_irq_line(struct pci_dev *pci_dev)
58083dade53cd4 Kumar Gala             2007-06-27  411  {
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  412  	int virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  413  	struct pci_intx_virq *vi, *vitmp;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  414  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  415  	/* Preallocate vi as rewind is complex if this fails after mapping */
450be4960a0fb8 Oliver O'Halloran      2020-12-02  416  	vi = kzalloc(sizeof(struct pci_intx_virq), GFP_KERNEL);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  417  	if (!vi)
450be4960a0fb8 Oliver O'Halloran      2020-12-02 @418  		return -1;
58083dade53cd4 Kumar Gala             2007-06-27  419  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  420  	pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
58083dade53cd4 Kumar Gala             2007-06-27  421  
58083dade53cd4 Kumar Gala             2007-06-27  422  	/* Try to get a mapping from the device-tree */
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  423  	virq = of_irq_parse_and_map_pci(pci_dev, 0, 0);
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  424  	if (virq <= 0) {
58083dade53cd4 Kumar Gala             2007-06-27  425  		u8 line, pin;
58083dade53cd4 Kumar Gala             2007-06-27  426  
58083dade53cd4 Kumar Gala             2007-06-27  427  		/* If that fails, lets fallback to what is in the config
58083dade53cd4 Kumar Gala             2007-06-27  428  		 * space and map that through the default controller. We
58083dade53cd4 Kumar Gala             2007-06-27  429  		 * also set the type to level low since that's what PCI
58083dade53cd4 Kumar Gala             2007-06-27  430  		 * interrupts are. If your platform does differently, then
58083dade53cd4 Kumar Gala             2007-06-27  431  		 * either provide a proper interrupt tree or don't use this
58083dade53cd4 Kumar Gala             2007-06-27  432  		 * function.
58083dade53cd4 Kumar Gala             2007-06-27  433  		 */
58083dade53cd4 Kumar Gala             2007-06-27  434  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
450be4960a0fb8 Oliver O'Halloran      2020-12-02  435  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  436  		if (pin == 0)
450be4960a0fb8 Oliver O'Halloran      2020-12-02  437  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  438  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  439  		    line == 0xff || line == 0) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  440  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  441  		}
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  442  		pr_debug(" No map ! Using line %d (pin %d) from PCI config\n",
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  443  			 line, pin);
58083dade53cd4 Kumar Gala             2007-06-27  444  
58083dade53cd4 Kumar Gala             2007-06-27  445  		virq = irq_create_mapping(NULL, line);
ef24ba7091517d Michael Ellerman       2016-09-06  446  		if (virq)
ec775d0e70eb6b Thomas Gleixner        2011-03-25  447  			irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
58083dade53cd4 Kumar Gala             2007-06-27  448  	}
ef24ba7091517d Michael Ellerman       2016-09-06  449  
ef24ba7091517d Michael Ellerman       2016-09-06  450  	if (!virq) {
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  451  		pr_debug(" Failed to map !\n");
450be4960a0fb8 Oliver O'Halloran      2020-12-02  452  		goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  453  	}
58083dade53cd4 Kumar Gala             2007-06-27  454  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  455  	pr_debug(" Mapped to linux irq %d\n", virq);
58083dade53cd4 Kumar Gala             2007-06-27  456  
58083dade53cd4 Kumar Gala             2007-06-27  457  	pci_dev->irq = virq;
58083dade53cd4 Kumar Gala             2007-06-27  458  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  459  	mutex_lock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  460  	list_for_each_entry(vitmp, &intx_list, list_node) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  461  		if (vitmp->virq == virq) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  462  			kref_get(&vitmp->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  463  			kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  464  			vi = NULL;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  465  			break;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  466  		}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  467  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  468  	if (vi) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  469  		vi->virq = virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  470  		kref_init(&vi->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  471  		list_add_tail(&vi->list_node, &intx_list);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  472  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  473  	mutex_unlock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  474  
58083dade53cd4 Kumar Gala             2007-06-27  475  	return 0;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  476  error_exit:
450be4960a0fb8 Oliver O'Halloran      2020-12-02  477  	kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  478  	return -1;
58083dade53cd4 Kumar Gala             2007-06-27  479  }
58083dade53cd4 Kumar Gala             2007-06-27  480  

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

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy
@ 2021-08-03  9:09 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-08-03  9:09 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Oliver O'Halloran" <oohall@gmail.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
CC: Alexey Kardashevskiy <aik@ozlabs.ru>
CC: Frederic Barrat <fbarrat@linux.ibm.com>
CC: "Cédric Le Goater" <clg@kaod.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c500bee1c5b2f1d59b1081ac879d73268ab0ff17
commit: 450be4960a0fb89b931a6bb3c3f0bb538ac4c03c powerpc/pci: Remove LSI mappings on device teardown
date:   8 months ago
:::::: branch date: 33 hours ago
:::::: commit date: 8 months ago
config: powerpc-randconfig-m031-20210803 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 10.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:
arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy

vim +418 arch/powerpc/kernel/pci-common.c

450be4960a0fb8 Oliver O'Halloran      2020-12-02  404  
58083dade53cd4 Kumar Gala             2007-06-27  405  /*
58083dade53cd4 Kumar Gala             2007-06-27  406   * Reads the interrupt pin to determine if interrupt is use by card.
58083dade53cd4 Kumar Gala             2007-06-27  407   * If the interrupt is used, then gets the interrupt line from the
58083dade53cd4 Kumar Gala             2007-06-27  408   * openfirmware and sets it in the pci_dev and pci_config line.
58083dade53cd4 Kumar Gala             2007-06-27  409   */
4666ca2aa34410 Benjamin Herrenschmidt 2011-11-29  410  static int pci_read_irq_line(struct pci_dev *pci_dev)
58083dade53cd4 Kumar Gala             2007-06-27  411  {
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  412  	int virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  413  	struct pci_intx_virq *vi, *vitmp;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  414  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  415  	/* Preallocate vi as rewind is complex if this fails after mapping */
450be4960a0fb8 Oliver O'Halloran      2020-12-02  416  	vi = kzalloc(sizeof(struct pci_intx_virq), GFP_KERNEL);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  417  	if (!vi)
450be4960a0fb8 Oliver O'Halloran      2020-12-02 @418  		return -1;
58083dade53cd4 Kumar Gala             2007-06-27  419  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  420  	pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev));
58083dade53cd4 Kumar Gala             2007-06-27  421  
58083dade53cd4 Kumar Gala             2007-06-27  422  	/* Try to get a mapping from the device-tree */
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  423  	virq = of_irq_parse_and_map_pci(pci_dev, 0, 0);
c591c2e36ccc9a Alexey Kardashevskiy   2018-02-09  424  	if (virq <= 0) {
58083dade53cd4 Kumar Gala             2007-06-27  425  		u8 line, pin;
58083dade53cd4 Kumar Gala             2007-06-27  426  
58083dade53cd4 Kumar Gala             2007-06-27  427  		/* If that fails, lets fallback to what is in the config
58083dade53cd4 Kumar Gala             2007-06-27  428  		 * space and map that through the default controller. We
58083dade53cd4 Kumar Gala             2007-06-27  429  		 * also set the type to level low since that's what PCI
58083dade53cd4 Kumar Gala             2007-06-27  430  		 * interrupts are. If your platform does differently, then
58083dade53cd4 Kumar Gala             2007-06-27  431  		 * either provide a proper interrupt tree or don't use this
58083dade53cd4 Kumar Gala             2007-06-27  432  		 * function.
58083dade53cd4 Kumar Gala             2007-06-27  433  		 */
58083dade53cd4 Kumar Gala             2007-06-27  434  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
450be4960a0fb8 Oliver O'Halloran      2020-12-02  435  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  436  		if (pin == 0)
450be4960a0fb8 Oliver O'Halloran      2020-12-02  437  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  438  		if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  439  		    line == 0xff || line == 0) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  440  			goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  441  		}
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  442  		pr_debug(" No map ! Using line %d (pin %d) from PCI config\n",
54a24cbbd0184f Benjamin Herrenschmidt 2007-12-20  443  			 line, pin);
58083dade53cd4 Kumar Gala             2007-06-27  444  
58083dade53cd4 Kumar Gala             2007-06-27  445  		virq = irq_create_mapping(NULL, line);
ef24ba7091517d Michael Ellerman       2016-09-06  446  		if (virq)
ec775d0e70eb6b Thomas Gleixner        2011-03-25  447  			irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
58083dade53cd4 Kumar Gala             2007-06-27  448  	}
ef24ba7091517d Michael Ellerman       2016-09-06  449  
ef24ba7091517d Michael Ellerman       2016-09-06  450  	if (!virq) {
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  451  		pr_debug(" Failed to map !\n");
450be4960a0fb8 Oliver O'Halloran      2020-12-02  452  		goto error_exit;
58083dade53cd4 Kumar Gala             2007-06-27  453  	}
58083dade53cd4 Kumar Gala             2007-06-27  454  
b0494bc8ee449f Benjamin Herrenschmidt 2008-10-27  455  	pr_debug(" Mapped to linux irq %d\n", virq);
58083dade53cd4 Kumar Gala             2007-06-27  456  
58083dade53cd4 Kumar Gala             2007-06-27  457  	pci_dev->irq = virq;
58083dade53cd4 Kumar Gala             2007-06-27  458  
450be4960a0fb8 Oliver O'Halloran      2020-12-02  459  	mutex_lock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  460  	list_for_each_entry(vitmp, &intx_list, list_node) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  461  		if (vitmp->virq == virq) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  462  			kref_get(&vitmp->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  463  			kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  464  			vi = NULL;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  465  			break;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  466  		}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  467  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  468  	if (vi) {
450be4960a0fb8 Oliver O'Halloran      2020-12-02  469  		vi->virq = virq;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  470  		kref_init(&vi->kref);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  471  		list_add_tail(&vi->list_node, &intx_list);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  472  	}
450be4960a0fb8 Oliver O'Halloran      2020-12-02  473  	mutex_unlock(&intx_mutex);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  474  
58083dade53cd4 Kumar Gala             2007-06-27  475  	return 0;
450be4960a0fb8 Oliver O'Halloran      2020-12-02  476  error_exit:
450be4960a0fb8 Oliver O'Halloran      2020-12-02  477  	kfree(vi);
450be4960a0fb8 Oliver O'Halloran      2020-12-02  478  	return -1;
58083dade53cd4 Kumar Gala             2007-06-27  479  }
58083dade53cd4 Kumar Gala             2007-06-27  480  

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

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-17 12:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 14:12 arch/powerpc/kernel/pci-common.c:418 pci_read_irq_line() warn: returning -1 instead of -ENOMEM is sloppy kernel test robot
2021-06-22 14:22 ` Dan Carpenter
2021-06-22 14:22 ` Dan Carpenter
2021-08-03  9:09 kernel test robot
2021-09-10  7:54 kernel test robot
2021-11-12 21:22 kernel test robot
2021-11-14  2:27 kernel test robot
2021-11-17 12:04 kernel test robot

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.