All of lore.kernel.org
 help / color / mirror / Atom feed
* [omap-audio:peter/ti-linux-5.4.y/wip 5716/9999] drivers/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock'.
@ 2020-06-28 11:57 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-06-28 11:57 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
TO: Peter Ujfalusi <peter.ujfalusi@ti.com>

tree:   https://github.com/omap-audio/linux-audio peter/ti-linux-5.4.y/wip
head:   d4ea716deb5cae567d7ffb483c1cc6a18ca0d3ba
commit: 46241066755af938ddbf829f86ae15b2eebaa3f5 [5716/9999] PCI: endpoint: Add support to add virtual function in endpoint core
:::::: branch date: 10 days ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-m001-20200628 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 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/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock'.

# https://github.com/omap-audio/linux-audio/commit/46241066755af938ddbf829f86ae15b2eebaa3f5
git remote add omap-audio https://github.com/omap-audio/linux-audio
git remote update omap-audio
git checkout 46241066755af938ddbf829f86ae15b2eebaa3f5
vim +133 drivers/pci/endpoint/pci-epf-core.c

5e8cb4033807e3 Kishon Vijay Abraham I 2017-04-10   97  
46241066755af9 Kishon Vijay Abraham I 2020-01-23   98  /**
46241066755af9 Kishon Vijay Abraham I 2020-01-23   99   * pci_epf_add_vepf() - associate virtual EP function to physical EP function
46241066755af9 Kishon Vijay Abraham I 2020-01-23  100   * @epf_pf: the physical EP function to which the virtual EP function should be
46241066755af9 Kishon Vijay Abraham I 2020-01-23  101   *   associated
46241066755af9 Kishon Vijay Abraham I 2020-01-23  102   * @epf_vf: the virtual EP function to be added
46241066755af9 Kishon Vijay Abraham I 2020-01-23  103   *
46241066755af9 Kishon Vijay Abraham I 2020-01-23  104   * A physical endpoint function can be associated with multiple virtual
46241066755af9 Kishon Vijay Abraham I 2020-01-23  105   * endpoint functions. Invoke pci_epf_add_epf() to add a virtual PCI endpoint
46241066755af9 Kishon Vijay Abraham I 2020-01-23  106   * function to a physical PCI endpoint function.
46241066755af9 Kishon Vijay Abraham I 2020-01-23  107   */
46241066755af9 Kishon Vijay Abraham I 2020-01-23  108  int pci_epf_add_vepf(struct pci_epf *epf_pf, struct pci_epf *epf_vf)
46241066755af9 Kishon Vijay Abraham I 2020-01-23  109  {
46241066755af9 Kishon Vijay Abraham I 2020-01-23  110  	u32 vfunc_no;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  111  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  112  	if (IS_ERR_OR_NULL(epf_pf) || IS_ERR_OR_NULL(epf_vf))
46241066755af9 Kishon Vijay Abraham I 2020-01-23  113  		return -EINVAL;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  114  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  115  	if (epf_pf->epc || epf_vf->epc || epf_vf->epf_pf)
46241066755af9 Kishon Vijay Abraham I 2020-01-23  116  		return -EBUSY;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  117  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  118  	mutex_lock(&epf_pf->lock);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  119  	vfunc_no = find_first_zero_bit(&epf_pf->vfunction_num_map,
46241066755af9 Kishon Vijay Abraham I 2020-01-23  120  				       BITS_PER_LONG);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  121  	if (vfunc_no >= BITS_PER_LONG)
46241066755af9 Kishon Vijay Abraham I 2020-01-23  122  		return -EINVAL;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  123  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  124  	set_bit(vfunc_no, &epf_pf->vfunction_num_map);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  125  	epf_vf->vfunc_no = vfunc_no;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  126  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  127  	epf_vf->epf_pf = epf_pf;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  128  	epf_vf->is_vf = true;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  129  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  130  	list_add_tail(&epf_vf->list, &epf_pf->pci_vepf);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  131  	mutex_unlock(&epf_pf->lock);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  132  
46241066755af9 Kishon Vijay Abraham I 2020-01-23 @133  	return 0;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  134  }
46241066755af9 Kishon Vijay Abraham I 2020-01-23  135  EXPORT_SYMBOL_GPL(pci_epf_add_vepf);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  136  

---
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: 30539 bytes --]

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

* [omap-audio:peter/ti-linux-5.4.y/wip 5716/9999] drivers/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock'.
@ 2020-06-29 10:46 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-06-29 10:46 UTC (permalink / raw)
  To: kbuild

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

tree:   https://github.com/omap-audio/linux-audio peter/ti-linux-5.4.y/wip
head:   d4ea716deb5cae567d7ffb483c1cc6a18ca0d3ba
commit: 46241066755af938ddbf829f86ae15b2eebaa3f5 [5716/9999] PCI: endpoint: Add support to add virtual function in endpoint core
config: x86_64-randconfig-m001-20200628 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 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/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock'.

# https://github.com/omap-audio/linux-audio/commit/46241066755af938ddbf829f86ae15b2eebaa3f5
git remote add omap-audio https://github.com/omap-audio/linux-audio
git remote update omap-audio
git checkout 46241066755af938ddbf829f86ae15b2eebaa3f5
vim +133 drivers/pci/endpoint/pci-epf-core.c

46241066755af9 Kishon Vijay Abraham I 2020-01-23  108  int pci_epf_add_vepf(struct pci_epf *epf_pf, struct pci_epf *epf_vf)
46241066755af9 Kishon Vijay Abraham I 2020-01-23  109  {
46241066755af9 Kishon Vijay Abraham I 2020-01-23  110  	u32 vfunc_no;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  111  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  112  	if (IS_ERR_OR_NULL(epf_pf) || IS_ERR_OR_NULL(epf_vf))
46241066755af9 Kishon Vijay Abraham I 2020-01-23  113  		return -EINVAL;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  114  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  115  	if (epf_pf->epc || epf_vf->epc || epf_vf->epf_pf)
46241066755af9 Kishon Vijay Abraham I 2020-01-23  116  		return -EBUSY;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  117  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  118  	mutex_lock(&epf_pf->lock);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  119  	vfunc_no = find_first_zero_bit(&epf_pf->vfunction_num_map,
46241066755af9 Kishon Vijay Abraham I 2020-01-23  120  				       BITS_PER_LONG);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  121  	if (vfunc_no >= BITS_PER_LONG)
46241066755af9 Kishon Vijay Abraham I 2020-01-23  122  		return -EINVAL;

Need to unlock before returning.

46241066755af9 Kishon Vijay Abraham I 2020-01-23  123  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  124  	set_bit(vfunc_no, &epf_pf->vfunction_num_map);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  125  	epf_vf->vfunc_no = vfunc_no;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  126  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  127  	epf_vf->epf_pf = epf_pf;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  128  	epf_vf->is_vf = true;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  129  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  130  	list_add_tail(&epf_vf->list, &epf_pf->pci_vepf);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  131  	mutex_unlock(&epf_pf->lock);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  132  
46241066755af9 Kishon Vijay Abraham I 2020-01-23 @133  	return 0;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  134  }

---
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: 30539 bytes --]

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

* [omap-audio:peter/ti-linux-5.4.y/wip 5716/9999] drivers/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock'.
@ 2020-06-29 10:46 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2020-06-29 10:46 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://github.com/omap-audio/linux-audio peter/ti-linux-5.4.y/wip
head:   d4ea716deb5cae567d7ffb483c1cc6a18ca0d3ba
commit: 46241066755af938ddbf829f86ae15b2eebaa3f5 [5716/9999] PCI: endpoint: Add support to add virtual function in endpoint core
config: x86_64-randconfig-m001-20200628 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 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/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock'.

# https://github.com/omap-audio/linux-audio/commit/46241066755af938ddbf829f86ae15b2eebaa3f5
git remote add omap-audio https://github.com/omap-audio/linux-audio
git remote update omap-audio
git checkout 46241066755af938ddbf829f86ae15b2eebaa3f5
vim +133 drivers/pci/endpoint/pci-epf-core.c

46241066755af9 Kishon Vijay Abraham I 2020-01-23  108  int pci_epf_add_vepf(struct pci_epf *epf_pf, struct pci_epf *epf_vf)
46241066755af9 Kishon Vijay Abraham I 2020-01-23  109  {
46241066755af9 Kishon Vijay Abraham I 2020-01-23  110  	u32 vfunc_no;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  111  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  112  	if (IS_ERR_OR_NULL(epf_pf) || IS_ERR_OR_NULL(epf_vf))
46241066755af9 Kishon Vijay Abraham I 2020-01-23  113  		return -EINVAL;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  114  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  115  	if (epf_pf->epc || epf_vf->epc || epf_vf->epf_pf)
46241066755af9 Kishon Vijay Abraham I 2020-01-23  116  		return -EBUSY;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  117  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  118  	mutex_lock(&epf_pf->lock);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  119  	vfunc_no = find_first_zero_bit(&epf_pf->vfunction_num_map,
46241066755af9 Kishon Vijay Abraham I 2020-01-23  120  				       BITS_PER_LONG);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  121  	if (vfunc_no >= BITS_PER_LONG)
46241066755af9 Kishon Vijay Abraham I 2020-01-23  122  		return -EINVAL;

Need to unlock before returning.

46241066755af9 Kishon Vijay Abraham I 2020-01-23  123  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  124  	set_bit(vfunc_no, &epf_pf->vfunction_num_map);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  125  	epf_vf->vfunc_no = vfunc_no;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  126  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  127  	epf_vf->epf_pf = epf_pf;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  128  	epf_vf->is_vf = true;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  129  
46241066755af9 Kishon Vijay Abraham I 2020-01-23  130  	list_add_tail(&epf_vf->list, &epf_pf->pci_vepf);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  131  	mutex_unlock(&epf_pf->lock);
46241066755af9 Kishon Vijay Abraham I 2020-01-23  132  
46241066755af9 Kishon Vijay Abraham I 2020-01-23 @133  	return 0;
46241066755af9 Kishon Vijay Abraham I 2020-01-23  134  }

---
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: 30539 bytes --]

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

end of thread, other threads:[~2020-06-29 10:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-29 10:46 [omap-audio:peter/ti-linux-5.4.y/wip 5716/9999] drivers/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock' Dan Carpenter
2020-06-29 10:46 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2020-06-28 11:57 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.