From: Julien Cristau Subject: Re: xf86-video-intel: 3 commits - src/intel_display.c src/intel_dri.c src/intel.h Date: Thu, 24 Mar 2011 19:31:03 +0100 Message-ID: <20110324183103.GF3159@radis.liafa.jussieu.fr> References: <20110324002457.C7976F80E7@kemper.freedesktop.org> <20110324010256.GX3159@radis.liafa.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from coloquinte.cristau.org (coloquinte.cristau.org [91.121.16.100]) by gabe.freedesktop.org (Postfix) with ESMTP id 80F569E7AD for ; Thu, 24 Mar 2011 11:31:06 -0700 (PDT) Content-Disposition: inline In-Reply-To: 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: Keith Packard Cc: Keith Packard , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Mar 24, 2011 at 11:09:36 -0700, Keith Packard wrote: > diff --git a/src/intel_dri.c b/src/intel_dri.c > index 3b80823..f7a4fc4 100644 > --- a/src/intel_dri.c > +++ b/src/intel_dri.c > @@ -625,8 +625,10 @@ i830_dri2_add_frame_event(DRI2FrameEventPtr frame_event) > if (!AddResource(frame_event->client_id, frame_event_client_type, frame_event)) > return FALSE; > > - if (!AddResource(frame_event->drawable_id, frame_event_drawable_type, frame_event)) > + if (!AddResource(frame_event->drawable_id, frame_event_drawable_type, frame_event)) { > + FreeResourceByType(frame_event->client_id, frame_event_client_type, TRUE); > return FALSE; > + } > > return TRUE; > } > @@ -705,7 +707,10 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel, > flip_info->event_data = data; > flip_info->frame = target_msc; > > - i830_dri2_add_frame_event(flip_info); > + if (!i830_dri2_add_frame_event(flip_info)) { > + free(flip_info); > + return FALSE; > + } > > /* Page flip the full screen buffer */ > back_priv = back->driverPrivate; > @@ -958,7 +963,10 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, > I830DRI2ReferenceBuffer(front); > I830DRI2ReferenceBuffer(back); > > - i830_dri2_add_frame_event(swap_info); > + if (!i830_dri2_add_frame_event(swap_info)) { > + free(swap_info); This will cause a double free as the blit_fallback path does it too. > + goto blit_fallback; > + } > > /* Get current count */ > vbl.request.type = DRM_VBLANK_RELATIVE; > Cheers, Julien