]> git.baikalelectronics.ru Git - kernel.git/commit
i915: don't call drm_atomic_state_put on invalid pointer
authorArnd Bergmann <arnd@arndb.de>
Tue, 18 Oct 2016 15:16:23 +0000 (17:16 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 19 Oct 2016 07:23:33 +0000 (09:23 +0200)
commitada55ebba730b0be86cc13c8a68552dc65fde04a
tree432268c50deb5538e1534e42bc9eaa4b2253ba7e
parent2d608868bc1c956c80ff579985433fe19e9e9a9a
i915: don't call drm_atomic_state_put on invalid pointer

The introduction of reference counting on the state structures caused
sanitize_watermarks() in i915 to break in the error handling case,
as pointed out by gcc -Wmaybe-uninitialized

drivers/gpu/drm/i915/intel_display.c: In function ‘intel_modeset_init’:
include/drm/drm_atomic.h:224:2: error: ‘state’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

This changes the function back to only drop the reference count
when it was successfully allocated first.

Fixes: 9058b84abc9d ("drm: Add reference counting to drm_atomic_state")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161018151652.2690201-1-arnd@arndb.de
drivers/gpu/drm/i915/intel_display.c