From: Lars-Peter Clausen Date: Thu, 1 Aug 2013 16:30:38 +0000 (+0200) Subject: ASoC: dapm: Fix empty list check in dapm_new_mux() X-Git-Tag: v3.11-rc6~9^2~1^2~2^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe581391147cb3d738d961d0f1233d91a9e1113c;p=pandora-kernel.git ASoC: dapm: Fix empty list check in dapm_new_mux() list_first_entry() will always return a valid pointer, even if the list is empty. So the check whether path is NULL will always be false. So we end up calling dapm_create_or_share_mixmux_kcontrol() with a path struct that points right in the middle of the widget struct and by trying to modify the path the widgets memory will become corrupted. Fix this by using list_emtpy() to check if the widget doesn't have any paths. Signed-off-by: Lars-Peter Clausen Tested-by: Stephen Warren Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- Reading git-diff-tree failed