All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: [ti:ti-linux-5.4.y 2795/9671] drivers/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock'.
Date: Tue, 15 Sep 2020 14:02:48 +0300	[thread overview]
Message-ID: <20200915110248.GF4282@kadam> (raw)

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

tree:   git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.4.y
head:   5fd9bb3f78d32f23d809e9c2a689925c7bd774f9
commit: 46241066755af938ddbf829f86ae15b2eebaa3f5 [2795/9671] PCI: endpoint: Add support to add virtual function in endpoint core
config: x86_64-randconfig-m001-20200913 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

smatch warnings:
drivers/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock'.

git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-linux-5.4.y
git checkout 46241066755af938ddbf829f86ae15b2eebaa3f5
vim +133 drivers/pci/endpoint/pci-epf-core.c

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

46241066755af93 Kishon Vijay Abraham I 2020-01-23  119  	vfunc_no = find_first_zero_bit(&epf_pf->vfunction_num_map,
46241066755af93 Kishon Vijay Abraham I 2020-01-23  120  				       BITS_PER_LONG);
46241066755af93 Kishon Vijay Abraham I 2020-01-23  121  	if (vfunc_no >= BITS_PER_LONG)
46241066755af93 Kishon Vijay Abraham I 2020-01-23  122  		return -EINVAL;
                                                                        ^^^^^^^^^^^^^^
ret = -EINVAL;
goto unlock?

46241066755af93 Kishon Vijay Abraham I 2020-01-23  123  
46241066755af93 Kishon Vijay Abraham I 2020-01-23  124  	set_bit(vfunc_no, &epf_pf->vfunction_num_map);
46241066755af93 Kishon Vijay Abraham I 2020-01-23  125  	epf_vf->vfunc_no = vfunc_no;
46241066755af93 Kishon Vijay Abraham I 2020-01-23  126  
46241066755af93 Kishon Vijay Abraham I 2020-01-23  127  	epf_vf->epf_pf = epf_pf;
46241066755af93 Kishon Vijay Abraham I 2020-01-23  128  	epf_vf->is_vf = true;
46241066755af93 Kishon Vijay Abraham I 2020-01-23  129  
46241066755af93 Kishon Vijay Abraham I 2020-01-23  130  	list_add_tail(&epf_vf->list, &epf_pf->pci_vepf);
46241066755af93 Kishon Vijay Abraham I 2020-01-23  131  	mutex_unlock(&epf_pf->lock);
46241066755af93 Kishon Vijay Abraham I 2020-01-23  132  
46241066755af93 Kishon Vijay Abraham I 2020-01-23 @133  	return 0;
46241066755af93 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: 33392 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [ti:ti-linux-5.4.y 2795/9671] drivers/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock'.
Date: Tue, 15 Sep 2020 14:02:48 +0300	[thread overview]
Message-ID: <20200915110248.GF4282@kadam> (raw)

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

tree:   git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.4.y
head:   5fd9bb3f78d32f23d809e9c2a689925c7bd774f9
commit: 46241066755af938ddbf829f86ae15b2eebaa3f5 [2795/9671] PCI: endpoint: Add support to add virtual function in endpoint core
config: x86_64-randconfig-m001-20200913 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

smatch warnings:
drivers/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock'.

git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-linux-5.4.y
git checkout 46241066755af938ddbf829f86ae15b2eebaa3f5
vim +133 drivers/pci/endpoint/pci-epf-core.c

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

46241066755af93 Kishon Vijay Abraham I 2020-01-23  119  	vfunc_no = find_first_zero_bit(&epf_pf->vfunction_num_map,
46241066755af93 Kishon Vijay Abraham I 2020-01-23  120  				       BITS_PER_LONG);
46241066755af93 Kishon Vijay Abraham I 2020-01-23  121  	if (vfunc_no >= BITS_PER_LONG)
46241066755af93 Kishon Vijay Abraham I 2020-01-23  122  		return -EINVAL;
                                                                        ^^^^^^^^^^^^^^
ret = -EINVAL;
goto unlock?

46241066755af93 Kishon Vijay Abraham I 2020-01-23  123  
46241066755af93 Kishon Vijay Abraham I 2020-01-23  124  	set_bit(vfunc_no, &epf_pf->vfunction_num_map);
46241066755af93 Kishon Vijay Abraham I 2020-01-23  125  	epf_vf->vfunc_no = vfunc_no;
46241066755af93 Kishon Vijay Abraham I 2020-01-23  126  
46241066755af93 Kishon Vijay Abraham I 2020-01-23  127  	epf_vf->epf_pf = epf_pf;
46241066755af93 Kishon Vijay Abraham I 2020-01-23  128  	epf_vf->is_vf = true;
46241066755af93 Kishon Vijay Abraham I 2020-01-23  129  
46241066755af93 Kishon Vijay Abraham I 2020-01-23  130  	list_add_tail(&epf_vf->list, &epf_pf->pci_vepf);
46241066755af93 Kishon Vijay Abraham I 2020-01-23  131  	mutex_unlock(&epf_pf->lock);
46241066755af93 Kishon Vijay Abraham I 2020-01-23  132  
46241066755af93 Kishon Vijay Abraham I 2020-01-23 @133  	return 0;
46241066755af93 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: 33392 bytes --]

             reply	other threads:[~2020-09-15 11:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 11:02 Dan Carpenter [this message]
2020-09-15 11:02 ` [ti:ti-linux-5.4.y 2795/9671] drivers/pci/endpoint/pci-epf-core.c:133 pci_epf_add_vepf() warn: inconsistent returns 'epf_pf->lock' Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2020-09-15  6:05 kernel test robot

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=20200915110248.GF4282@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild@lists.01.org \
    /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.