[alsa-devel] [PATCH] ASoC: dapm: Fix empty list check in dapm_new_mux()

Stephen Warren swarren at wwwdotorg.org
Thu Aug 1 19:20:34 CEST 2013

On 08/01/2013 10:30 AM, Lars-Peter Clausen wrote:
> 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 at metafoo.de>
> ---
> This is the real fix for the rt5640 crash.

Tested-by: Stephen Warren <swarren at nvidia.com>

More information about the Alsa-devel mailing list