OSDN Git Service

ASoC: ux500: mop500: Fix some refcounted resources issues
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 12 May 2020 10:07:05 +0000 (12:07 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 12 May 2020 16:14:34 +0000 (17:14 +0100)
commit4e8748fcaeec073e3ba794871ce86c545e4f961f
tree330364cece3276ae5adbe1ed7f6c865e2ad9c143
parent936b9df7a5c00db92088b3c51316d5f551ee5b2c
ASoC: ux500: mop500: Fix some refcounted resources issues

There are 2 issues here:
   - if one of the 'of_parse_phandle' fails, calling 'mop500_of_node_put()'
     is a no-op because the 'mop500_dai_links' structure has not been
     initialized yet, so the referenced are not decremented
   - The reference stored in 'mop500_dai_links[i].codecs' is refcounted
     only once in the probe and must be decremented only once.

Fixes: 39013bd60e79 ("ASoC: Ux500: Dispose of device nodes correctly")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20200512100705.246349-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/ux500/mop500.c