Skip to content

Commit

Permalink
drm/i915: Prevent uninitialised reads during error state capture
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Wilson committed Jan 24, 2011
1 parent b705120 commit 8e934db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/i915_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,8 @@ static void i915_capture_error_state(struct drm_device *dev)
i++;
error->pinned_bo_count = i - error->active_bo_count;

error->active_bo = NULL;
error->pinned_bo = NULL;
if (i) {
error->active_bo = kmalloc(sizeof(*error->active_bo)*i,
GFP_ATOMIC);
Expand Down

0 comments on commit 8e934db

Please sign in to comment.