From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 05/34] drm/i915: Call context fini at cleanup Date: Sun, 26 May 2013 15:27:50 +0200 Message-ID: <20130526132750.GN15743@phenom.ffwll.local> References: <1369510028-3343-1-git-send-email-ben@bwidawsk.net> <1369510028-3343-6-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 133DFE5CC0 for ; Sun, 26 May 2013 06:27:55 -0700 (PDT) Received: by mail-wg0-f50.google.com with SMTP id k13so3682635wgh.17 for ; Sun, 26 May 2013 06:27:55 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1369510028-3343-6-git-send-email-ben@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: Intel GFX List-Id: intel-gfx@lists.freedesktop.org On Sat, May 25, 2013 at 12:26:39PM -0700, Ben Widawsky wrote: > If contexts were actually initialized, and we fail somewhere later during > init this would possibly leak memory, and lead to some error messages > about unclean takedown. As the odds of this occurring, and someone > actually caring/noticing are pretty slim, the patch isn't terribly > important. > > Found by code inspection while working on something else. > > Signed-off-by: Ben Widawsky Applied patches 1-5 to dinq, with a tiny bikeshed on patch 5. Wrt all these cleanup paths I think we should seriously look at more structured options like devres.c ... -Daniel > --- > drivers/gpu/drm/i915/i915_dma.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c > index fe969cf..3ae8298 100644 > --- a/drivers/gpu/drm/i915/i915_dma.c > +++ b/drivers/gpu/drm/i915/i915_dma.c > @@ -1359,6 +1359,7 @@ static int i915_load_modeset_init(struct drm_device *dev) > cleanup_gem: > mutex_lock(&dev->struct_mutex); > i915_gem_cleanup_ringbuffer(dev); > + i915_gem_context_fini(dev); > mutex_unlock(&dev->struct_mutex); > i915_gem_cleanup_aliasing_ppgtt(dev); > drm_mm_takedown(&dev_priv->mm.gtt_space); > -- > 1.8.2.3 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch