Skip to content

Commit

Permalink
drivers/gpu/drm/i915/i915_irq.c:i915_error_object_create(): use corre…
Browse files Browse the repository at this point in the history
…ct kmap-atomic slot

i915_error_object_create() is called from the timer interrupt and hence
can corrupt the KM_USER0 slot.  Use KM_IRQ0 instead.

Reported-by: Jaswinder Singh Rajput <jaswinderlinux@gmail.com>
Tested-by: Jaswinder Singh Rajput <jaswinderlinux@gmail.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed May 12, 2010
1 parent 06efbeb commit 788885a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/gpu/drm/i915/i915_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,15 @@ i915_error_object_create(struct drm_device *dev,

for (page = 0; page < page_count; page++) {
void *s, *d = kmalloc(PAGE_SIZE, GFP_ATOMIC);
unsigned long flags;

if (d == NULL)
goto unwind;
s = kmap_atomic(src_priv->pages[page], KM_USER0);
local_irq_save(flags);
s = kmap_atomic(src_priv->pages[page], KM_IRQ0);
memcpy(d, s, PAGE_SIZE);
kunmap_atomic(s, KM_USER0);
kunmap_atomic(s, KM_IRQ0);
local_irq_restore(flags);
dst->pages[page] = d;
}
dst->page_count = page_count;
Expand Down

0 comments on commit 788885a

Please sign in to comment.