linux-stable/sound/soc/qcom
Takashi Iwai 70b773219a
ASoC: qcom: Fix of-node refcount unbalance in qcom_snd_parse_of()
Although qcom_snd_parse_of() tries to manage the of-node refcount,
there are still a few places that lead to the unblanced refcount in
the error code path.  Namely,

- for_each_child_of_node() needs to unreference the iterator node if
  aborting the loop in the middle,
- cpu, codec and platform node objects have to be unreferenced at each
  iteration,
- platform and codec node objects have to be referred before jumping
  to the error handling code that unreference them unconditionally.

This patch tries to address these by moving the assignment of platform
and codec node objects to the beginning of the loop and adding the
of_node_put() calls adequately.

Fixes: c25e295cd7 ("ASoC: qcom: Add support to parse common audio device nodes")
Cc: Patrick Lai <plai@codeaurora.org>
Cc: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-20 16:43:42 +00:00
..
qdsp6 ASoC: qdsp6: q6asm-dai: Fix a small memory leak 2019-01-03 16:32:56 +00:00
apq8016_sbc.c ASoC: qcom: Fix of-node refcount unbalance in apq8016_sbc_parse_of() 2019-02-20 16:43:29 +00:00
apq8096.c ASoC: apq8096: add slim support 2019-01-28 18:19:10 +00:00
common.c ASoC: qcom: Fix of-node refcount unbalance in qcom_snd_parse_of() 2019-02-20 16:43:42 +00:00
common.h ASoC: qcom: remove unused header files from common.h 2018-08-06 12:50:07 +01:00
Kconfig ASoC: qcom: Kconfig: select dmic for sdm845 2019-02-18 17:42:22 +00:00
lpass-apq8016.c ASoC: qcom: move clock names into LPASS variant struct 2017-04-21 18:07:45 +01:00
lpass-cpu.c ASoC: qcom: move clock names into LPASS variant struct 2017-04-21 18:07:45 +01:00
lpass-ipq806x.c ASoC: qcom: move clock names into LPASS variant struct 2017-04-21 18:07:45 +01:00
lpass-lpaif-reg.h ASoC: qcom: add generic bit masks for RDMA and WRDMA 2016-02-20 01:20:18 +09:00
lpass-platform.c ASoC: qcom: clean up indentation, remove extraneous tab 2018-11-16 19:08:32 -08:00
lpass.h ASoC: qcom: move clock names into LPASS variant struct 2017-04-21 18:07:45 +01:00
Makefile ASoC: qcom: make common.c as proper module 2018-08-06 12:50:04 +01:00
sdm845.c ASoC: sdm845: Set DAI format for dmic codec 2019-01-16 16:33:02 +00:00
storm.c ASoC: qcom: Remove unnecessary function call 2017-08-21 17:14:00 +01:00