Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1503154

Re: [PATCH] i915: don't call drm_atomic_state_put on invalid pointer

From Chris Wilson <chris@chris-wilson.co.uk>
Newsgroups linux.kernel
Subject Re: [PATCH] i915: don't call drm_atomic_state_put on invalid pointer
Date 2016-10-18 18:00 +0200
Message-ID <stEY1-3IP-17@gated-at.bofh.it> (permalink)
References <stElj-3tp-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Oct 18, 2016 at 05:16:23PM +0200, Arnd Bergmann wrote:
> 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: 0853695c3ba4 ("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>

Yup, missed that it jumps to fail before allocating state.

Function still looks a bit odd, but nvm
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] i915: don't call drm_atomic_state_put on invalid pointer Arnd Bergmann <arnd@arndb.de> - 2016-10-18 17:20 +0200
  Re: [PATCH] i915: don't call drm_atomic_state_put on invalid pointer Eric Engestrom <eric.engestrom@imgtec.com> - 2016-10-18 17:30 +0200
  Re: [PATCH] i915: don't call drm_atomic_state_put on invalid pointer Chris Wilson <chris@chris-wilson.co.uk> - 2016-10-18 18:00 +0200
    Re: [Intel-gfx] [PATCH] i915: don't call drm_atomic_state_put on  invalid pointer Daniel Vetter <daniel@ffwll.ch> - 2016-10-19 16:50 +0200

csiph-web