]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: audio-graph-card: fix use-after-free in graph_for_each_link
authorWen Yang <wen.yang99@zte.com.cn>
Thu, 4 Jul 2019 08:38:50 +0000 (16:38 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:12:49 +0000 (09:12 +0200)
commitb2e77a926e590fc551e9e66d5e9f091c8f8eda0a
tree9f64503f7f52e44894b2113bf4aaca07f81d5c73
parentcbd7d2d8a7fe8a1c6e7f51437d7d24db8a3c91bb
ASoC: audio-graph-card: fix use-after-free in graph_for_each_link

[ Upstream commit 1bcc1fd64e4dd903f4d868a9e053986e3b102713 ]

After calling of_node_put() on the codec_ep and codec_port variables,
they are still being used, which may result in use-after-free.
We fix this issue by calling of_node_put() after the last usage.

Fixes: fce9b90c1ab7 ("ASoC: audio-graph-card: cleanup DAI link loop method - step2")
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/1562229530-8121-1-git-send-email-wen.yang99@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/generic/audio-graph-card.c