[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200924081830.GA1568157@mwanda>
Date: Thu, 24 Sep 2020 11:18:30 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Christoph Hellwig <hch@....de>,
Jani Nikula <jani.nikula@...ux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Chris Wilson <chris@...is-wilson.co.uk>,
Matthew Auld <matthew.auld@...el.com>,
Abdiel Janulgue <abdiel.janulgue@...ux.intel.com>,
Dave Airlie <airlied@...hat.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
intel-gfx@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH] drm/i915: Uninitialized variable in
i915_gem_object_map_page()
The "i" iterator is never set to zero. This probably doesn't affect
testing because GCC sometimes initializes variables and also we have a
new pluggin to initialize stack variables to zero.
Fixes: 7edd32a9e614 ("drm/i915: use vmap in i915_gem_object_map")
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
Hi Andrew, this should probably go through the -mm tree and get folded
into the original patch.
drivers/gpu/drm/i915/gem/i915_gem_pages.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pages.c b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
index 90029ea83aed..12bedabc1daa 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
@@ -266,6 +266,7 @@ static void *i915_gem_object_map_page(struct drm_i915_gem_object *obj,
return NULL;
}
+ i = 0;
for_each_sgt_page(page, iter, obj->mm.pages)
pages[i++] = page;
vaddr = vmap(pages, n_pages, 0, pgprot);
@@ -291,6 +292,7 @@ static void *i915_gem_object_map_pfn(struct drm_i915_gem_object *obj)
return NULL;
}
+ i = 0;
for_each_sgt_daddr(addr, iter, obj->mm.pages)
pfns[i++] = (iomap + addr) >> PAGE_SHIFT;
vaddr = vmap_pfn(pfns, n_pfn, pgprot_writecombine(PAGE_KERNEL_IO));
--
2.28.0
Powered by blists - more mailing lists