Commit d862a605 authored by Dan Carpenter's avatar Dan Carpenter Committed by sanglipeng
Browse files

ASoC: pxa: fix a memory leak in probe()

stable inclusion
from stable-v5.10.199
commit 05e06fb6a6423f1ab59210c1616abb8272e13e53
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I9AWJ5

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=05e06fb6a6423f1ab59210c1616abb8272e13e53



--------------------------------

[ Upstream commit aa6464ed ]

Free the "priv" pointer before returning the error code.

Fixes: 90eb6b59 ("ASoC: pxa-ssp: add support for an external clock in devicetree")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/84ac2313-1420-471a-b2cb-3269a2e12a7c@moroto.mountain


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 51e5ad75
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -797,7 +797,7 @@ static int pxa_ssp_probe(struct snd_soc_dai *dai)
		if (IS_ERR(priv->extclk)) {
			ret = PTR_ERR(priv->extclk);
			if (ret == -EPROBE_DEFER)
				return ret;
				goto err_priv;

			priv->extclk = NULL;
		}