From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915/sprite: Fix mem leak in intel_plane_init() Date: Wed, 27 Jun 2012 09:34:43 +0100 Message-ID: <1340786125_85379@CP5-2952> References: Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Jesper Juhl , linux-kernel@vger.kernel.org Cc: Jesse Barnes , dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter List-Id: dri-devel@lists.freedesktop.org On Wed, 27 Jun 2012 00:55:37 +0200 (CEST), Jesper Juhl wrote: > If we ever hit the default case in the switch statement we'll return > from the function without freeing the memory we just allocated to > 'intel_plane' (but that has not been used). > > This patch gets rid of the leak by freeing the memory just before we > return. Heh, I was more worried about the real leak of the planes on module unload. -Chris -- Chris Wilson, Intel Open Source Technology Centre