From: Dan Carpenter Date: Tue, 12 Jul 2022 14:42:12 +0000 (+0300) Subject: ASoC: amd: Fix error pointer dereference X-Git-Tag: v6.0-rc1~93^2~9^2~27^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=73acfba792b06156b7c805162fcd89fdb71646f9;p=thirdparty%2Fkernel%2Flinux.git ASoC: amd: Fix error pointer dereference The "gpio_pa" pointer is an error pointer, there is no need to try put it. Calling gpiod_put() on it will lead to an error pointer dereference. Fixes: 02527c3f2300 ("ASoC: amd: add Machine driver for Jadeite platform") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/Ys2IRPHWGIwuVs21@kili Signed-off-by: Mark Brown --- diff --git a/sound/soc/amd/acp-es8336.c b/sound/soc/amd/acp-es8336.c index d501618b78f6e..2fe8df86053ae 100644 --- a/sound/soc/amd/acp-es8336.c +++ b/sound/soc/amd/acp-es8336.c @@ -212,7 +212,6 @@ static int st_es8336_late_probe(struct snd_soc_card *card) if (IS_ERR(gpio_pa)) { ret = dev_err_probe(card->dev, PTR_ERR(gpio_pa), "could not get pa-enable GPIO\n"); - gpiod_put(gpio_pa); put_device(codec_dev); return ret; }