Commit 3e330ac
ASoC: codecs: wcd937x: fix a potential memory leak in wcd937x_soc_codec_probe()
When snd_soc_dapm_new_controls() or snd_soc_dapm_add_routes() fails,
wcd937x_soc_codec_probe() returns without releasing 'wcd937x->clsh_info',
which is allocated by wcd_clsh_ctrl_alloc. Add wcd_clsh_ctrl_free()
to prevent potential memory leak.
Fixes: 313e978 ("ASoC: codecs: wcd937x: add audio routing and Kconfig")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Link: https://patch.msgid.link/20250226085050.3584898-1-haoxiang_li2024@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent ede6445 commit 3e330ac
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2571 | 2571 | | |
2572 | 2572 | | |
2573 | 2573 | | |
| 2574 | + | |
2574 | 2575 | | |
2575 | 2576 | | |
2576 | 2577 | | |
2577 | 2578 | | |
2578 | 2579 | | |
2579 | 2580 | | |
2580 | 2581 | | |
| 2582 | + | |
2581 | 2583 | | |
2582 | 2584 | | |
2583 | 2585 | | |
| |||
0 commit comments