Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S943070AbcJSOtF (ORCPT ); Wed, 19 Oct 2016 10:49:05 -0400 Received: from mail-vk0-f50.google.com ([209.85.213.50]:33898 "EHLO mail-vk0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941646AbcJSOtA (ORCPT ); Wed, 19 Oct 2016 10:49:00 -0400 Date: Wed, 19 Oct 2016 09:25:04 +0200 From: Daniel Vetter To: Chris Wilson , Arnd Bergmann , Daniel Vetter , Jani Nikula , David Airlie , Daniel Vetter , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Maarten Lankhorst , Imre Deak , Ander Conselvan de Oliveira , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [Intel-gfx] [PATCH] i915: don't call drm_atomic_state_put on invalid pointer Message-ID: <20161019072504.GD20761@phenom.ffwll.local> Mail-Followup-To: Chris Wilson , Arnd Bergmann , Daniel Vetter , Jani Nikula , David Airlie , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Maarten Lankhorst , Imre Deak , Ander Conselvan de Oliveira , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20161018151652.2690201-1-arnd@arndb.de> <20161018155602.GG29358@nuc-i3427.alporthouse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20161018155602.GG29358@nuc-i3427.alporthouse.com> X-Operating-System: Linux phenom 4.6.0-1-amd64 User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1176 Lines: 28 On Tue, Oct 18, 2016 at 04:56:02PM +0100, Chris Wilson wrote: > 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 > > Cc: Daniel Vetter > > Signed-off-by: Arnd Bergmann > > Yup, missed that it jumps to fail before allocating state. > > Function still looks a bit odd, but nvm > Reviewed-by: Chris Wilson Applied to drm-misc, thanks for the patch&review. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch