OSDN Git Service

drm/i915: Fix null pointer dereference in ring cleanup code
authorJohn Harrison <John.C.Harrison@Intel.com>
Fri, 31 Oct 2014 12:00:26 +0000 (12:00 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 4 Nov 2014 22:22:14 +0000 (23:22 +0100)
commit6402c330a62685c77c32d1bdfa882759c9f8e8a7
tree3a8fdba207e57b5d1e2c32f0f57ee5a17f3ca57d
parentc883ef1b1c998d2d66866772fd0fc34afa45641e
drm/i915: Fix null pointer dereference in ring cleanup code

If a ring failed to initialise for any reason then the error path would try to
clean up all rings including those that had not yet been allocated. The ring
clean up code did a check that the ring was valid before starting its work.
Unfortunately, that was after it had already dereferenced the ring to obtain a
dev_private pointer.

Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c