• Kuninori Morimoto's avatar
    ASoC: soc-core: fixup references at soc_cleanup_card_resources() · 29040d1a
    Kuninori Morimoto authored
    commit 53e947a0 ("ASoC: soc-core: merge card resources cleanup
    method") merged cleanup method of snd_soc_instantiate_card() and
    soc_cleanup_card_resources().
    
    But, after this commit, if user uses unbind/bind to Component factor
    drivers, Kernel might indicates refcount error at
    soc_cleanup_card_resources().
    
    The 1st reason is card->snd_card is still exist even though
    snd_card_free() was called, but it is already cleaned.
    We need to set NULL to it.
    
    2nd is card->dapm and card create debugfs, but its dentry is still
    exist even though it was removed. We need to set NULL to it.
    
    Fixes: 53e947a0 ("ASoC: soc-core: merge card resources cleanup method")
    Cc: stable@vger.kernel.org # for v5.1
    Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    29040d1a
soc-dapm.c 118 KB