]> git.ipfire.org Git - people/arne_f/kernel.git/commit
ASoC: dapm: Fix empty list check in dapm_new_mux()
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 1 Aug 2013 16:30:38 +0000 (18:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Aug 2013 15:43:03 +0000 (08:43 -0700)
commit4bd3f15b77578866fda9b0da4ef027f06ed3b746
tree3181d776657e190ba88821e669e08db1f64d05f3
parent20fd3d46726e60f936e8901745a7d00bae32958f
ASoC: dapm: Fix empty list check in dapm_new_mux()

commit fe581391147cb3d738d961d0f1233d91a9e1113c upstream.

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 <lars@metafoo.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/soc-dapm.c