From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] ASoC: Fix double free and memory leak in many codec drivers Date: Mon, 25 Aug 2008 13:53:10 +0200 Message-ID: References: <1219661360-3555-1-git-send-email-broonie@opensource.wolfsonmicro.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 89FC510380A for ; Mon, 25 Aug 2008 13:53:10 +0200 (CEST) In-Reply-To: <1219661360-3555-1-git-send-email-broonie@opensource.wolfsonmicro.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: Jean Delvare , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 25 Aug 2008 11:49:20 +0100, Mark Brown wrote: > > From: Jean Delvare > > Many SoC audio codec drivers have improper freeing of memory in error > paths. > > * codec is allocated in the platform device probe function, but is not > freed there in case of error. Instead it is freed in the i2c device > probe function's error path. However the success or failure of both > functions is not linked, so this could result in a double free (if > the platform device is successfully probed, the i2c device probing > fails and then the platform driver is unregistered.) > > * codec->private_data is allocated in many platform device probe > functions but not freed in their error paths. > > This patch hopefully solves all these problems. > > Signed-off-by: Jean Delvare > Signed-off-by: Mark Brown This looks like a 2.6.27 material, right? I applied to for-linus branch now. Thanks. Takashi