]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: qdsp6: fix potential memory leak in q6apm_get_audioreach_graph()
authorJianglei Nie <niejianglei2021@163.com>
Wed, 29 Jun 2022 18:25:20 +0000 (02:25 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 7 Jul 2022 16:16:36 +0000 (17:16 +0100)
commit2b82c1c2afe25f839286501784f85ca4483852b5
treee97b89539ea2a7d71c9b9700ffd325ca2d8cb993
parentd433788a16d7a891a25e024f112dc7f550cc06c4
ASoC: qdsp6: fix potential memory leak in q6apm_get_audioreach_graph()

q6apm_get_audioreach_graph() allocates a memory chunk for graph->graph
with audioreach_alloc_graph_pkt(). When idr_alloc() fails, graph->graph
is not released, which will lead to a memory leak.

We can release the graph->graph with kfree() when idr_alloc() fails to
fix the memory leak.

Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220629182520.2164409-1-niejianglei2021@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/qdsp6/q6apm.c