* [tglx-devel:msi 100/101] drivers/pci/msi/msi.c:1050 pci_msix_expand_vectors_at() warn: variable dereferenced before check 'dev' (see line 1046)
@ 2021-11-30 9:56 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-11-30 9:56 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 5021 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Thomas Gleixner <tglx@linutronix.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi
head: 1fd2d0e8970556f4495ebc122b6e7f249393022e
commit: 4044aa7eefffadc52424d908337708eaa82cf84c [100/101] PCI/MSI: Provide pci_msix_expand_vectors[_at]()
:::::: branch date: 13 hours ago
:::::: commit date: 13 hours ago
config: x86_64-randconfig-m001-20211128 (https://download.01.org/0day-ci/archive/20211130/202111301709.vSHraXYF-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>
New smatch warnings:
drivers/pci/msi/msi.c:1050 pci_msix_expand_vectors_at() warn: variable dereferenced before check 'dev' (see line 1046)
Old smatch warnings:
drivers/pci/msi/msi.c:517 msix_setup_msi_descs() error: uninitialized symbol 'ret'.
vim +/dev +1050 drivers/pci/msi/msi.c
aff171641d181e drivers/pci/msi.c Christoph Hellwig 2016-07-12 1030
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1031 /**
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1032 * pci_msix_expand_vectors_at - Expand MSI-X interrupts for a device
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1033 *
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1034 * @dev: PCI device to operate on
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1035 * @at: Allocate at MSI-X index.
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1036 * @nvec: Number of vectors to allocate
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1037 *
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1038 * Expand the MSI-X vectors of a device after an initial enablement and
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1039 * allocation.
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1040 *
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1041 * Return: 0 if the allocation was successful, an error code otherwise.
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1042 */
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1043 int pci_msix_expand_vectors_at(struct pci_dev *dev, unsigned int at, unsigned int nvec)
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1044 {
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1045 struct msi_range range = MSI_RANGE_LINEAR(at, nvec);
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 @1046 struct msi_device_data *md = dev->dev.msi.data;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1047 unsigned int max_vecs;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1048 int ret;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1049
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 @1050 if (!pci_msi_enable || !dev || !dev->msix_enabled || !md)
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1051 return -ENOTSUPP;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1052
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1053 if (!pci_msi_domain_supports_expand(dev))
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1054 return -ENOTSUPP;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1055
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1056 max_vecs = pci_msix_vec_count(dev);
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1057 if (!nvec || nvec > max_vecs)
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1058 return -EINVAL;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1059
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1060 if (at >= max_vecs || nvec > max_vecs - at)
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1061 return -ENOSPC;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1062
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1063 ret = msix_setup_interrupts(dev, dev->msix_base, &range, NULL, NULL, true);
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1064 return ret <= 0 ? ret : -ENOSPC;
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1065 }
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1066 EXPORT_SYMBOL_GPL(pci_msix_expand_vectors_at);
4044aa7eefffad drivers/pci/msi/msi.c Thomas Gleixner 2021-11-22 1067
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-30 9:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-30 9:56 [tglx-devel:msi 100/101] drivers/pci/msi/msi.c:1050 pci_msix_expand_vectors_at() warn: variable dereferenced before check 'dev' (see line 1046) 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.