From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@lst.de>,
Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Chris Wilson <chris@chris-wilson.co.uk>,
Matthew Auld <matthew.auld@intel.com>,
Abdiel Janulgue <abdiel.janulgue@linux.intel.com>,
Dave Airlie <airlied@redhat.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] drm/i915: Uninitialized variable in i915_gem_object_map_page()
Date: Thu, 24 Sep 2020 11:18:30 +0300 [thread overview]
Message-ID: <20200924081830.GA1568157@mwanda> (raw)
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@oracle.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
next reply other threads:[~2020-09-24 8:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-24 8:18 Dan Carpenter [this message]
2020-09-24 8:26 ` [PATCH] drm/i915: Uninitialized variable in i915_gem_object_map_page() Christoph Hellwig
2020-09-24 23:15 ` Stephen Rothwell
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=20200924081830.GA1568157@mwanda \
--to=dan.carpenter@oracle.com \
--cc=abdiel.janulgue@linux.intel.com \
--cc=airlied@linux.ie \
--cc=airlied@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=chris@chris-wilson.co.uk \
--cc=daniel@ffwll.ch \
--cc=hch@lst.de \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.auld@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=sfr@canb.auug.org.au \
/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