Skip to content

Commit

Permalink
ASoC: codec2codec: avoid invalid/double-free of pcm runtime
Browse files Browse the repository at this point in the history
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: a72706e ("ASoC: codec2codec: remove ephemeral variables")
Cc: [email protected]
Signed-off-by: Samuel Holland <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
smaeul authored and broonie committed Feb 13, 2020
1 parent 1880b1f commit b6570fd
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3916,9 +3916,6 @@ snd_soc_dai_link_event_pre_pmu(struct snd_soc_dapm_widget *w,
runtime->rate = params_rate(params);

out:
if (ret < 0)
kfree(runtime);

kfree(params);
return ret;
}
Expand Down

0 comments on commit b6570fd

Please sign in to comment.