drm/i915: Avoid drm_atomic_state_put(NULL) on error paths
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Wed, 18 Jan 2017 12:34:28 +0000 (14:34 +0200)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 18 Jan 2017 13:47:22 +0000 (13:47 +0000)
commit1e5a15d65d4cecb553d7e81c3ac05b1ffbc4bb27
tree1efa7e845a2ebe29a5a840bf17ee3186cac14ac9
parent3c5e37f169cb67cbd03c6116fbc93e0805815d29
drm/i915: Avoid drm_atomic_state_put(NULL) on error paths

The error paths in hsw_trans_edp_pipe_A_crc_wa() and
intel_prepare_reset() would potentially call drm_atomic_state_put with a
NULL state, which would lead to a NULL pointer dereference.

Found by coverity.

v2: Improve the error paths. (Chris)

Fixes: 0853695c3ba4 ("drm: Add reference counting to drm_atomic_state")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.10-rc1+
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1484742868-9551-1-git-send-email-ander.conselvan.de.oliveira@intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_pipe_crc.c