Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937116AbcJRP4Q (ORCPT ); Tue, 18 Oct 2016 11:56:16 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:56392 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935562AbcJRP4H (ORCPT ); Tue, 18 Oct 2016 11:56:07 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Date: Tue, 18 Oct 2016 16:56:02 +0100 From: Chris Wilson To: Arnd Bergmann Cc: 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: [PATCH] i915: don't call drm_atomic_state_put on invalid pointer Message-ID: <20161018155602.GG29358@nuc-i3427.alporthouse.com> Mail-Followup-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 References: <20161018151652.2690201-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20161018151652.2690201-1-arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1001 Lines: 24 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 -Chris -- Chris Wilson, Intel Open Source Technology Centre