mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: arch/s390/pci/pci_mmio.c:35:1: sparse: sparse: Using plain integer as NULL pointer
Date: Sat, 9 Dec 2023 21:23:09 +0800	[thread overview]
Message-ID: <202312092144.nRcv9gfg-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f2e8a57ee9036c7d5443382b6c3c09b51a92ec7e
commit: aa0d6e70d3b34e710a6a57a53a3096cb2e0ea99f s390: autogenerate compat syscall wrappers
date:   4 years, 11 months ago
config: s390-randconfig-r113-20231115 (https://download.01.org/0day-ci/archive/20231209/202312092144.nRcv9gfg-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231209/202312092144.nRcv9gfg-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312092144.nRcv9gfg-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> arch/s390/pci/pci_mmio.c:35:1: sparse: sparse: Using plain integer as NULL pointer
>> arch/s390/pci/pci_mmio.c:35:1: sparse: sparse: Using plain integer as NULL pointer
   arch/s390/pci/pci_mmio.c:75:1: sparse: sparse: Using plain integer as NULL pointer
   arch/s390/pci/pci_mmio.c:75:1: sparse: sparse: Using plain integer as NULL pointer
--
>> kernel/acct.c:273:1: sparse: sparse: Using plain integer as NULL pointer
>> kernel/acct.c:273:1: sparse: sparse: Using plain integer as NULL pointer
   kernel/acct.c:193:12: sparse: sparse: context imbalance in 'acct_on' - different lock contexts for basic block
   kernel/acct.c:294:9: sparse: sparse: context imbalance in '__se_sys_acct' - different lock contexts for basic block
   kernel/acct.c:297:6: sparse: sparse: context imbalance in 'acct_exit_ns' - wrong count at exit

vim +35 arch/s390/pci/pci_mmio.c

4eafad7febd482 Alexey Ishchuk 2014-11-14  34  
4eafad7febd482 Alexey Ishchuk 2014-11-14 @35  SYSCALL_DEFINE3(s390_pci_mmio_write, unsigned long, mmio_addr,
4eafad7febd482 Alexey Ishchuk 2014-11-14  36  		const void __user *, user_buffer, size_t, length)
4eafad7febd482 Alexey Ishchuk 2014-11-14  37  {
4eafad7febd482 Alexey Ishchuk 2014-11-14  38  	u8 local_buf[64];
4eafad7febd482 Alexey Ishchuk 2014-11-14  39  	void __iomem *io_addr;
4eafad7febd482 Alexey Ishchuk 2014-11-14  40  	void *buf;
4eafad7febd482 Alexey Ishchuk 2014-11-14  41  	unsigned long pfn;
4eafad7febd482 Alexey Ishchuk 2014-11-14  42  	long ret;
4eafad7febd482 Alexey Ishchuk 2014-11-14  43  
4eafad7febd482 Alexey Ishchuk 2014-11-14  44  	if (!zpci_is_enabled())
4eafad7febd482 Alexey Ishchuk 2014-11-14  45  		return -ENODEV;
4eafad7febd482 Alexey Ishchuk 2014-11-14  46  
4eafad7febd482 Alexey Ishchuk 2014-11-14  47  	if (length <= 0 || PAGE_SIZE - (mmio_addr & ~PAGE_MASK) < length)
4eafad7febd482 Alexey Ishchuk 2014-11-14  48  		return -EINVAL;
4eafad7febd482 Alexey Ishchuk 2014-11-14  49  	if (length > 64) {
4eafad7febd482 Alexey Ishchuk 2014-11-14  50  		buf = kmalloc(length, GFP_KERNEL);
4eafad7febd482 Alexey Ishchuk 2014-11-14  51  		if (!buf)
4eafad7febd482 Alexey Ishchuk 2014-11-14  52  			return -ENOMEM;
4eafad7febd482 Alexey Ishchuk 2014-11-14  53  	} else
4eafad7febd482 Alexey Ishchuk 2014-11-14  54  		buf = local_buf;
4eafad7febd482 Alexey Ishchuk 2014-11-14  55  
4eafad7febd482 Alexey Ishchuk 2014-11-14  56  	ret = get_pfn(mmio_addr, VM_WRITE, &pfn);
4eafad7febd482 Alexey Ishchuk 2014-11-14  57  	if (ret)
4eafad7febd482 Alexey Ishchuk 2014-11-14  58  		goto out;
eba8452525e3fd Heiko Carstens 2014-12-12  59  	io_addr = (void __iomem *)((pfn << PAGE_SHIFT) | (mmio_addr & ~PAGE_MASK));
4eafad7febd482 Alexey Ishchuk 2014-11-14  60  
4eafad7febd482 Alexey Ishchuk 2014-11-14  61  	ret = -EFAULT;
4eafad7febd482 Alexey Ishchuk 2014-11-14  62  	if ((unsigned long) io_addr < ZPCI_IOMAP_ADDR_BASE)
4eafad7febd482 Alexey Ishchuk 2014-11-14  63  		goto out;
4eafad7febd482 Alexey Ishchuk 2014-11-14  64  
4eafad7febd482 Alexey Ishchuk 2014-11-14  65  	if (copy_from_user(buf, user_buffer, length))
4eafad7febd482 Alexey Ishchuk 2014-11-14  66  		goto out;
4eafad7febd482 Alexey Ishchuk 2014-11-14  67  
f0483044c1c960 Sebastian Ott  2015-02-25  68  	ret = zpci_memcpy_toio(io_addr, buf, length);
4eafad7febd482 Alexey Ishchuk 2014-11-14  69  out:
4eafad7febd482 Alexey Ishchuk 2014-11-14  70  	if (buf != local_buf)
4eafad7febd482 Alexey Ishchuk 2014-11-14  71  		kfree(buf);
4eafad7febd482 Alexey Ishchuk 2014-11-14  72  	return ret;
4eafad7febd482 Alexey Ishchuk 2014-11-14  73  }
4eafad7febd482 Alexey Ishchuk 2014-11-14  74  

:::::: The code at line 35 was first introduced by commit
:::::: 4eafad7febd482092b331ea72c37274d745956be s390/kernel: add system calls for PCI memory access

:::::: TO: Alexey Ishchuk <aishchuk@linux.vnet.ibm.com>
:::::: CC: Martin Schwidefsky <schwidefsky@de.ibm.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2023-12-09 13:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202312092144.nRcv9gfg-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnd@arndb.de \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=schwidefsky@de.ibm.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

all inboxes | Powered by JetHome®