[Intel-gfx] [PATCH 3/9] drm/i915: fix memleak in intel_set_config_save_state()
Chris Wilson
chris at chris-wilson.co.uk
Fri Aug 29 09:50:20 CEST 2014
On Fri, Aug 29, 2014 at 10:38:43AM +0300, Jani Nikula wrote:
> On Thu, 28 Aug 2014, Gustavo Padovan <gustavo at padovan.org> wrote:
> > From: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
> >
> > If the save_encoder_crtcs or save_connector_encoders allocation fail
> > we need to free everything we have already allocated.
>
> There is no memleak, because the caller of intel_set_config_save_state()
> checks the return value, and subsequently handles the error with a call
> to intel_set_config_free(), which does the right thing.
>
> I know one could argue this should be done within
> intel_set_config_save_state() but I'm not convinced. I'd let this be as
> it is.
>
> Just in case Daniel disagrees with me here and wants to merge, the patch
> does look correct. So r-b for correctness, but nak on merging from
> me. ;)
You just said it triggers a double free... And you would be right.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list