Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753692Ab2F0Ifp (ORCPT ); Wed, 27 Jun 2012 04:35:45 -0400 Received: from smtp.fireflyinternet.com ([109.228.6.236]:30377 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751199Ab2F0Ifl (ORCPT ); Wed, 27 Jun 2012 04:35:41 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.66.37; From: Chris Wilson Subject: Re: [PATCH] drm/i915/sprite: Fix mem leak in intel_plane_init() To: Jesper Juhl , linux-kernel@vger.kernel.org Cc: Jesse Barnes , dri-devel@lists.freedesktop.org, David Airlie , Daniel Vetter In-Reply-To: References: Date: Wed, 27 Jun 2012 09:34:43 +0100 X-Originating-IP: 78.156.66.37 Message-ID: <1340786125_85379@CP5-2952> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 734 Lines: 19 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/