aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorJohn Harrison <John.C.Harrison@Intel.com>2014-12-05 08:49:34 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-12-05 19:46:26 -0500
commitaaeb1ba041aedf2b58cd1303fd5fa9cf9173fa9b (patch)
tree55089db644192712aee5e63751a387dc2ee473cb /drivers/gpu/drm/i915/intel_ringbuffer.c
parent146d84f0f2707bfe2c67114eeefac30da8584b3b (diff)
drm/i915: Zero fill the request structure
There is a general theory that kzmalloc is better/safer than kmalloc, especially for interesting data structures. This change updates the request structure allocation to be zero filled. This also fixes crashes in the reset code. Quoting Mika's patch: "Clean the request structure on alloc. Otherwise we might end up referencing uninitialized fields. This is apparent when we try to cleanup the preallocated request on ring reset, before any request has been submitted to the ring. The request->ctx is foobar and we end up freeing the foobarness." Note that this fixes a regression introduced in commit 9eba5d4a1d79d5094321469479b4dbe418f60110 Author: John Harrison <John.C.Harrison@Intel.com> Date: Mon Nov 24 18:49:23 2014 +0000 drm/i915: Ensure OLS & PLR are always in sync References: https://bugs.freedesktop.org/show_bug.cgi?id=86959 References: https://bugs.freedesktop.org/show_bug.cgi?id=86962 References: https://bugs.freedesktop.org/show_bug.cgi?id=86992 Change-Id: I68715ef758025fab8db763941ef63bf60d7031e2 For: VIZ-4377 Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Thomas Daniel <Thomas.Daniel@intel.com> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index f52101521653..882821913937 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -2032,7 +2032,7 @@ intel_ring_alloc_request(struct intel_engine_cs *ring)
2032 if (ring->outstanding_lazy_request) 2032 if (ring->outstanding_lazy_request)
2033 return 0; 2033 return 0;
2034 2034
2035 request = kmalloc(sizeof(*request), GFP_KERNEL); 2035 request = kzalloc(sizeof(*request), GFP_KERNEL);
2036 if (request == NULL) 2036 if (request == NULL)
2037 return -ENOMEM; 2037 return -ENOMEM;
2038 2038