From: Jean Delvare Date: Mon, 25 Aug 2008 10:49:20 +0000 (+0100) Subject: ALSA: ASoC: Fix double free and memory leak in many codec drivers X-Git-Tag: v2.6.27-rc5~37^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3051e41ab7daaa59d4564f20b25dcb8c03f35f2b;p=pandora-kernel.git ALSA: ASoC: Fix double free and memory leak in many codec drivers 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 Signed-off-by: Takashi Iwai --- Reading git-diff-tree failed