Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: codec2codec: avoid invalid/double-free of pcm runtime

The PCM runtime was freed during PMU in the case that the event hook
encountered an error. However, it is also unconditionally freed during
PMD. Avoid a double-free by dropping the call to kfree in the PMU hook.

Fixes: a72706ed8208 ("ASoC: codec2codec: remove ephemeral variables")
Cc: stable@vger.kernel.org
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20200213061147.29386-2-samuel@sholland.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Samuel Holland and committed by
Mark Brown
b6570fdb 1880b1f1

-3
-3
sound/soc/soc-dapm.c
··· 3916 3916 runtime->rate = params_rate(params); 3917 3917 3918 3918 out: 3919 - if (ret < 0) 3920 - kfree(runtime); 3921 - 3922 3919 kfree(params); 3923 3920 return ret; 3924 3921 }