aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-01-24 07:34:00 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2011-01-24 13:28:29 -0500
commit8e934dbf264418afe4d1dff34ce074ecc14280db (patch)
tree6fcbbafc58a1f444b065905a2b3a3e5427cc6c92 /drivers/gpu
parentb705120e4198315f4ae043de06c62f65e0851fd3 (diff)
drm/i915: Prevent uninitialised reads during error state capture
error_bo and pinned_bo could be used uninitialised if there were no active buffers. Caught by kmemcheck. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 4b5a35c88bec..062f353497e6 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -846,6 +846,8 @@ static void i915_capture_error_state(struct drm_device *dev)
846 i++; 846 i++;
847 error->pinned_bo_count = i - error->active_bo_count; 847 error->pinned_bo_count = i - error->active_bo_count;
848 848
849 error->active_bo = NULL;
850 error->pinned_bo = NULL;
849 if (i) { 851 if (i) {
850 error->active_bo = kmalloc(sizeof(*error->active_bo)*i, 852 error->active_bo = kmalloc(sizeof(*error->active_bo)*i,
851 GFP_ATOMIC); 853 GFP_ATOMIC);