• Curtis Malainey's avatar
    ASoC: soc-core: clear platform pointers on error · 78a24e10
    Curtis Malainey authored
    Originally snd_soc_init_platform was not cleaning up its pointers, this
    was fixed to always reallocate dynamic memory but created a memory leak
    when snd_soc_init_platform was called multiple times during the same
    probe attempt and also threw away any changes made to the struct between
    calls. In order to avoid reallocating memory that is still valid, the
    behaviour will be changed to clear the dynamically set pointers on a
    probe error and a unregister event and snd_soc_init_platform will go
    back to its original behaviour of only allocating null pointers so it will
    stop throwing away valid changes.
    Signed-off-by: default avatarCurtis Malainey <cujomalainey@chromium.org>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    78a24e10
soc-core.c 97.5 KB