From: Daniel Mack Date: Tue, 7 Oct 2014 11:41:24 +0000 (+0200) Subject: ASoC: soc-dapm: fix use after free X-Git-Tag: fixes-against-v3.18-rc2~128^2^2~1^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5092c96c9c28f4d12811edcd02ca8eec16e748e;p=pandora-kernel.git ASoC: soc-dapm: fix use after free Coverity spotted the following possible use-after-free condition in dapm_create_or_share_mixmux_kcontrol(): If kcontrol is NULL, and (wname_in_long_name && kcname_in_long_name) validates to true, 'name' will be set to an allocated string, and be freed a few lines later via the 'long_name' alias. 'name', however, is used by dev_err() in case snd_ctl_add() fails. Fix this by adding a jump label that frees 'long_name' at the end of the function. Signed-off-by: Daniel Mack Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- Reading git-diff-tree failed