* [linux-next:master 8015/8469] drivers/gpu/drm/i915/i915_mm.c:76 remap_io_sg() error: uninitialized symbol 'err'.
@ 2021-03-29 23:12 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-03-29 23:12 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 4332 bytes --]
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Christoph Hellwig <hch@lst.de>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
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
:::::: branch date: 13 hours ago
:::::: commit date: 23 hours ago
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 34
1764b992be0f1c Abdiel Janulgue 2019-12-31 35 /**
4e598fad226be0 Abdiel Janulgue 2020-01-03 36 * remap_io_sg - remap an IO mapping to userspace
1764b992be0f1c Abdiel Janulgue 2019-12-31 37 * @vma: user vma to map to
1764b992be0f1c Abdiel Janulgue 2019-12-31 38 * @addr: target user address to start at
1764b992be0f1c Abdiel Janulgue 2019-12-31 39 * @size: size of map area
1764b992be0f1c Abdiel Janulgue 2019-12-31 40 * @sgl: Start sg entry
4e598fad226be0 Abdiel Janulgue 2020-01-03 41 * @iobase: Use stored dma address offset by this address or pfn if -1
1764b992be0f1c Abdiel Janulgue 2019-12-31 42 *
1764b992be0f1c Abdiel Janulgue 2019-12-31 43 * Note: this is only safe if the mm semaphore is held when called.
1764b992be0f1c Abdiel Janulgue 2019-12-31 44 */
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;
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(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28034 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [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
-1 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-04-01 7:55 UTC (permalink / raw)
To: Dan Carpenter
Cc: kbuild, Christoph Hellwig, lkp, kbuild-all,
Linux Memory Management List, Andrew Morton
On Tue, Mar 30, 2021 at 01:01:52PM +0300, Dan Carpenter wrote:
> drivers/gpu/drm/i915/i915_mm.c:76 remap_io_sg() error: uninitialized symbol 'err'.
Having an SGL where the first entry has a 0 dma_length is not valid.
That being said, the trivial patch below will remove the warning and
is otherwise harmless, so we could fold it in:
diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
index 4c8cd08c672d2d..25576fa73ff031 100644
--- a/drivers/gpu/drm/i915/i915_mm.c
+++ b/drivers/gpu/drm/i915/i915_mm.c
@@ -47,7 +47,7 @@ int remap_io_sg(struct vm_area_struct *vma,
struct scatterlist *sgl, resource_size_t iobase)
{
unsigned long pfn, len, remapped = 0;
- int err;
+ int err = 0;
/* We rely on prevalidation of the io-mapping to skip track_pfn(). */
GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [linux-next:master 8015/8469] drivers/gpu/drm/i915/i915_mm.c:76 remap_io_sg() error: uninitialized symbol 'err'.
@ 2021-04-01 7:55 ` Christoph Hellwig
0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-04-01 7:55 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 871 bytes --]
On Tue, Mar 30, 2021 at 01:01:52PM +0300, Dan Carpenter wrote:
> drivers/gpu/drm/i915/i915_mm.c:76 remap_io_sg() error: uninitialized symbol 'err'.
Having an SGL where the first entry has a 0 dma_length is not valid.
That being said, the trivial patch below will remove the warning and
is otherwise harmless, so we could fold it in:
diff --git a/drivers/gpu/drm/i915/i915_mm.c b/drivers/gpu/drm/i915/i915_mm.c
index 4c8cd08c672d2d..25576fa73ff031 100644
--- a/drivers/gpu/drm/i915/i915_mm.c
+++ b/drivers/gpu/drm/i915/i915_mm.c
@@ -47,7 +47,7 @@ int remap_io_sg(struct vm_area_struct *vma,
struct scatterlist *sgl, resource_size_t iobase)
{
unsigned long pfn, len, remapped = 0;
- int err;
+ int err = 0;
/* We rely on prevalidation of the io-mapping to skip track_pfn(). */
GEM_BUG_ON((vma->vm_flags & EXPECTED_FLAGS) != EXPECTED_FLAGS);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [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
0 siblings, 0 replies; 6+ 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] 6+ messages in thread
* [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
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2021-03-30 10:01 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 3311 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(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28034 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [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
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2021-03-30 10:01 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 3311 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(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28034 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-04-01 7:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 23:12 [linux-next:master 8015/8469] drivers/gpu/drm/i915/i915_mm.c:76 remap_io_sg() error: uninitialized symbol 'err' kernel test robot
2021-03-30 10:01 Dan Carpenter
2021-03-30 10:01 ` Dan Carpenter
2021-03-30 10:01 ` Dan Carpenter
2021-04-01 7:55 ` Christoph Hellwig
2021-04-01 7:55 ` Christoph Hellwig
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.