linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Christoph Hellwig <hch@lst.de>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [linux-next:master 8015/8469] drivers/gpu/drm/i915/i915_mm.c:76 remap_io_sg() error: uninitialized symbol 'err'.
Date: Tue, 30 Mar 2021 13:01:52 +0300	[thread overview]
Message-ID: <20210330100152.GC2065@kadam> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   9d49ed9ca93b8c564033c1d6808017bc9052b5db
commit: 204302d90503407d2af233c1222b2e79f35580f3 [8015/8469] i915: fix remap_io_sg to verify the pgprot
config: i386-randconfig-m021-20210329 (attached as .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>

smatch warnings:
drivers/gpu/drm/i915/i915_mm.c:76 remap_io_sg() error: uninitialized symbol 'err'.

vim +/err +76 drivers/gpu/drm/i915/i915_mm.c

4e598fad226be0 Abdiel Janulgue   2020-01-03  45  int remap_io_sg(struct vm_area_struct *vma,
1764b992be0f1c Abdiel Janulgue   2019-12-31  46  		unsigned long addr, unsigned long size,
4e598fad226be0 Abdiel Janulgue   2020-01-03  47  		struct scatterlist *sgl, resource_size_t iobase)
1764b992be0f1c Abdiel Janulgue   2019-12-31  48  {
204302d9050340 Christoph Hellwig 2021-03-29  49  	unsigned long pfn, len, remapped = 0;
1764b992be0f1c Abdiel Janulgue   2019-12-31  50  	int err;
1764b992be0f1c Abdiel Janulgue   2019-12-31  51  
1764b992be0f1c Abdiel Janulgue   2019-12-31  52  	/* We rely on prevalidation of the io-mapping to skip track_pfn(). */
1764b992be0f1c Abdiel Janulgue   2019-12-31  53  	GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
1764b992be0f1c Abdiel Janulgue   2019-12-31  54  
4e598fad226be0 Abdiel Janulgue   2020-01-03  55  	if (!use_dma(iobase))
1764b992be0f1c Abdiel Janulgue   2019-12-31  56  		flush_cache_range(vma, addr, size);
4e598fad226be0 Abdiel Janulgue   2020-01-03  57  
204302d9050340 Christoph Hellwig 2021-03-29  58  	do {
204302d9050340 Christoph Hellwig 2021-03-29  59  		if (use_dma(iobase)) {
204302d9050340 Christoph Hellwig 2021-03-29  60  			if (!sg_dma_len(sgl))
204302d9050340 Christoph Hellwig 2021-03-29  61  				break;
                                                                                ^^^^^
Can this break on the first iteration through the loop?

204302d9050340 Christoph Hellwig 2021-03-29  62  			pfn = (sg_dma_address(sgl) + iobase) >> PAGE_SHIFT;
204302d9050340 Christoph Hellwig 2021-03-29  63  			len = sg_dma_len(sgl);
204302d9050340 Christoph Hellwig 2021-03-29  64  		} else {
204302d9050340 Christoph Hellwig 2021-03-29  65  			pfn = page_to_pfn(sg_page(sgl));
204302d9050340 Christoph Hellwig 2021-03-29  66  			len = sgl->length;
1764b992be0f1c Abdiel Janulgue   2019-12-31  67  		}
1764b992be0f1c Abdiel Janulgue   2019-12-31  68  
204302d9050340 Christoph Hellwig 2021-03-29  69  		err = remap_pfn_range(vma, addr + remapped, pfn, len,
204302d9050340 Christoph Hellwig 2021-03-29  70  				      vma->vm_page_prot);
204302d9050340 Christoph Hellwig 2021-03-29  71  		if (err)
204302d9050340 Christoph Hellwig 2021-03-29  72  			break;
204302d9050340 Christoph Hellwig 2021-03-29  73  		remapped += len;
204302d9050340 Christoph Hellwig 2021-03-29  74  	} while ((sgl = __sg_next(sgl)));
204302d9050340 Christoph Hellwig 2021-03-29  75  
204302d9050340 Christoph Hellwig 2021-03-29 @76  	if (err)

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28034 bytes --]

             reply	other threads:[~2021-03-30 10:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 10:01 Dan Carpenter [this message]
2021-04-01  7:55 ` [linux-next:master 8015/8469] drivers/gpu/drm/i915/i915_mm.c:76 remap_io_sg() error: uninitialized symbol 'err' Christoph Hellwig

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=20210330100152.GC2065@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --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;
as well as URLs for NNTP newsgroup(s).