summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMatthias Reichl <hias@horus.com>2020-02-20 21:29:56 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-12 13:00:26 +0100
commit94c472e7b4e15eb460a9fdabcfe867fd863dd2b4 (patch)
tree8f8dd41d59f5063854f3ff5bea39cc27ef0b6bf9 /sound
parent757ed44a19a3a26f3c70aedb74ecc42c2f24346b (diff)
downloadlinux-stable-94c472e7b4e15eb460a9fdabcfe867fd863dd2b4.tar.gz
linux-stable-94c472e7b4e15eb460a9fdabcfe867fd863dd2b4.tar.bz2
linux-stable-94c472e7b4e15eb460a9fdabcfe867fd863dd2b4.zip
ASoC: pcm512x: Fix unbalanced regulator enable call in probe error path
commit ac0a68997935c4acb92eaae5ad8982e0bb432d56 upstream. When we get a clock error during probe we have to call regulator_bulk_disable before bailing out, otherwise we trigger a warning in regulator_put. Fix this by using "goto err" like in the error cases above. Fixes: 5a3af1293194d ("ASoC: pcm512x: Add PCM512x driver") Signed-off-by: Matthias Reichl <hias@horus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20200220202956.29233-1-hias@horus.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/pcm512x.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index 861210f6bf4f..4cbef9affffd 100644
--- a/sound/soc/codecs/pcm512x.c
+++ b/sound/soc/codecs/pcm512x.c
@@ -1564,13 +1564,15 @@ int pcm512x_probe(struct device *dev, struct regmap *regmap)
}
pcm512x->sclk = devm_clk_get(dev, NULL);
- if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER)
- return -EPROBE_DEFER;
+ if (PTR_ERR(pcm512x->sclk) == -EPROBE_DEFER) {
+ ret = -EPROBE_DEFER;
+ goto err;
+ }
if (!IS_ERR(pcm512x->sclk)) {
ret = clk_prepare_enable(pcm512x->sclk);
if (ret != 0) {
dev_err(dev, "Failed to enable SCLK: %d\n", ret);
- return ret;
+ goto err;
}
}