ASoC: wcd9335: Fix a memory leak in the error handling path of the probe function
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 16 Aug 2021 05:25:20 +0000 (07:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 08:02:29 +0000 (10:02 +0200)
commit27759b8ac582624c4adcea27730fa26852f4d22b
tree6b740f61e7f1d918dcc88e798dee20342fbc7702
parente502c911d005a4ddb69dd73dcd41b3f19d54d101
ASoC: wcd9335: Fix a memory leak in the error handling path of the probe function

[ Upstream commit fc6fc81caa63900cef9ebb8b2e365c3ed5a9effb ]

If 'wcd9335_setup_irqs()' fails, me must release the memory allocated in
'wcd_clsh_ctrl_alloc()', as already done in the remove function.

Add an error handling path and the missing 'wcd_clsh_ctrl_free()' call.

Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Message-Id: <6dc12372f09fabb70bf05941dbe6a1382dc93e43.1629091028.git.christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/wcd9335.c