public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Clean the request structure on alloc
@ 2014-12-05 17:54 Mika Kuoppala
  2014-12-05 17:54 ` John Harrison
  2014-12-05 21:41 ` shuang.he
  0 siblings, 2 replies; 6+ messages in thread
From: Mika Kuoppala @ 2014-12-05 17:54 UTC (permalink / raw)
  To: intel-gfx

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.

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
Cc: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 79b4ca5..2c6c6f8 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -2030,7 +2030,7 @@ intel_ring_alloc_request(struct intel_engine_cs *ring)
 	if (ring->outstanding_lazy_request)
 		return 0;
 
-	request = kmalloc(sizeof(*request), GFP_KERNEL);
+	request = kzalloc(sizeof(*request), GFP_KERNEL);
 	if (request == NULL)
 		return -ENOMEM;
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2014-12-05 21:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-05 17:54 [PATCH] drm/i915: Clean the request structure on alloc Mika Kuoppala
2014-12-05 17:54 ` John Harrison
2014-12-05 18:02   ` John Harrison
2014-12-05 20:44     ` Daniel Vetter
2014-12-05 18:09   ` Mika Kuoppala
2014-12-05 21:41 ` shuang.he

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox