From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, "Krzysztof Wilczyński" <kw@linux.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
Linux Memory Management List <linux-mm@kvack.org>,
Bjorn Helgaas <helgaas@kernel.org>
Subject: [linux-next:master 4244/5318] drivers/pci/syscall.c:82 __do_sys_pciconfig_read() error: uninitialized symbol 'dev'.
Date: Thu, 5 Aug 2021 14:54:10 +0300 [thread overview]
Message-ID: <202108051314.rzRzb79i-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 2f73937c9aa561e2082839bc1a8efaac75d6e244
commit: 61a6199787d97660d99aa3399c9165c0cf752211 [4244/5318] PCI: Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure
config: ia64-randconfig-m031-20210804 (attached as .config)
compiler: ia64-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:
drivers/pci/syscall.c:82 __do_sys_pciconfig_read() error: uninitialized symbol 'dev'.
drivers/pci/syscall.c:82 __do_sys_pciconfig_read() error: uninitialized symbol 'dev'.
vim +/dev +82 drivers/pci/syscall.c
c4ea37c26a691a Heiko Carstens 2009-01-14 15 SYSCALL_DEFINE5(pciconfig_read, unsigned long, bus, unsigned long, dfn,
c4ea37c26a691a Heiko Carstens 2009-01-14 16 unsigned long, off, unsigned long, len, void __user *, buf)
^1da177e4c3f41 Linus Torvalds 2005-04-16 17 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 18 struct pci_dev *dev;
^^^^^^^^^^^^^^^^^^^^
^1da177e4c3f41 Linus Torvalds 2005-04-16 19 u8 byte;
^1da177e4c3f41 Linus Torvalds 2005-04-16 20 u16 word;
^1da177e4c3f41 Linus Torvalds 2005-04-16 21 u32 dword;
e4585da22ad04a Alan Cox 2007-04-23 22 long err;
ef9e4005cbaf02 Heiner Kallweit 2021-01-24 23 int cfg_ret;
^1da177e4c3f41 Linus Torvalds 2005-04-16 24
61a6199787d976 Krzysztof Wilczyński 2021-07-29 25 err = -EPERM;
^1da177e4c3f41 Linus Torvalds 2005-04-16 26 if (!capable(CAP_SYS_ADMIN))
61a6199787d976 Krzysztof Wilczyński 2021-07-29 27 goto error;
^^^^^^^^^^
^1da177e4c3f41 Linus Torvalds 2005-04-16 28
^1da177e4c3f41 Linus Torvalds 2005-04-16 29 err = -ENODEV;
39c9465204e8f4 Sinan Kaya 2017-12-19 30 dev = pci_get_domain_bus_and_slot(0, bus, dfn);
^1da177e4c3f41 Linus Torvalds 2005-04-16 31 if (!dev)
^1da177e4c3f41 Linus Torvalds 2005-04-16 32 goto error;
^1da177e4c3f41 Linus Torvalds 2005-04-16 33
^1da177e4c3f41 Linus Torvalds 2005-04-16 34 switch (len) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 35 case 1:
e04b0ea2e0f9c1 Brian King 2005-09-27 36 cfg_ret = pci_user_read_config_byte(dev, off, &byte);
^1da177e4c3f41 Linus Torvalds 2005-04-16 37 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 38 case 2:
e04b0ea2e0f9c1 Brian King 2005-09-27 39 cfg_ret = pci_user_read_config_word(dev, off, &word);
^1da177e4c3f41 Linus Torvalds 2005-04-16 40 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 41 case 4:
e04b0ea2e0f9c1 Brian King 2005-09-27 42 cfg_ret = pci_user_read_config_dword(dev, off, &dword);
^1da177e4c3f41 Linus Torvalds 2005-04-16 43 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 44 default:
^1da177e4c3f41 Linus Torvalds 2005-04-16 45 err = -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 46 goto error;
f7625980f5820e Bjorn Helgaas 2013-11-14 47 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 48
^1da177e4c3f41 Linus Torvalds 2005-04-16 49 err = -EIO;
ef9e4005cbaf02 Heiner Kallweit 2021-01-24 50 if (cfg_ret)
^1da177e4c3f41 Linus Torvalds 2005-04-16 51 goto error;
^1da177e4c3f41 Linus Torvalds 2005-04-16 52
^1da177e4c3f41 Linus Torvalds 2005-04-16 53 switch (len) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 54 case 1:
^1da177e4c3f41 Linus Torvalds 2005-04-16 55 err = put_user(byte, (unsigned char __user *)buf);
^1da177e4c3f41 Linus Torvalds 2005-04-16 56 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 57 case 2:
^1da177e4c3f41 Linus Torvalds 2005-04-16 58 err = put_user(word, (unsigned short __user *)buf);
^1da177e4c3f41 Linus Torvalds 2005-04-16 59 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 60 case 4:
^1da177e4c3f41 Linus Torvalds 2005-04-16 61 err = put_user(dword, (unsigned int __user *)buf);
^1da177e4c3f41 Linus Torvalds 2005-04-16 62 break;
e4585da22ad04a Alan Cox 2007-04-23 63 }
e4585da22ad04a Alan Cox 2007-04-23 64 pci_dev_put(dev);
^1da177e4c3f41 Linus Torvalds 2005-04-16 65 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 66
^1da177e4c3f41 Linus Torvalds 2005-04-16 67 error:
^1da177e4c3f41 Linus Torvalds 2005-04-16 68 /* ??? XFree86 doesn't even check the return value. They
^1da177e4c3f41 Linus Torvalds 2005-04-16 69 just look for 0xffffffff in the output, since that's what
^1da177e4c3f41 Linus Torvalds 2005-04-16 70 they get instead of a machine check on x86. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 71 switch (len) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 72 case 1:
^1da177e4c3f41 Linus Torvalds 2005-04-16 73 put_user(-1, (unsigned char __user *)buf);
^1da177e4c3f41 Linus Torvalds 2005-04-16 74 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 75 case 2:
^1da177e4c3f41 Linus Torvalds 2005-04-16 76 put_user(-1, (unsigned short __user *)buf);
^1da177e4c3f41 Linus Torvalds 2005-04-16 77 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 78 case 4:
^1da177e4c3f41 Linus Torvalds 2005-04-16 79 put_user(-1, (unsigned int __user *)buf);
^1da177e4c3f41 Linus Torvalds 2005-04-16 80 break;
e4585da22ad04a Alan Cox 2007-04-23 81 }
e4585da22ad04a Alan Cox 2007-04-23 @82 pci_dev_put(dev);
^^^
Uninitialized.
^1da177e4c3f41 Linus Torvalds 2005-04-16 83 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 84 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next reply other threads:[~2021-08-05 11:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-05 11:54 Dan Carpenter [this message]
2021-08-05 19:55 ` Bjorn Helgaas
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=202108051314.rzRzb79i-lkp@intel.com \
--to=dan.carpenter@oracle.com \
--cc=helgaas@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=kw@linux.com \
--cc=linux-mm@kvack.org \
--cc=lkp@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox