linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 8015/8469] drivers/gpu/drm/i915/i915_mm.c:76 remap_io_sg() error: uninitialized symbol 'err'.
@ 2021-03-30 10:01 Dan Carpenter
  2021-04-01  7:55 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-03-30 10:01 UTC (permalink / raw)
  To: kbuild, Christoph Hellwig
  Cc: lkp, kbuild-all, Linux Memory Management List, Andrew Morton

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-01  7:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-30 10:01 [linux-next:master 8015/8469] drivers/gpu/drm/i915/i915_mm.c:76 remap_io_sg() error: uninitialized symbol 'err' Dan Carpenter
2021-04-01  7:55 ` Christoph Hellwig

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).