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: 02527c3f23 ("ASoC: amd: add Machine driver for Jadeite platform")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Ys2IRPHWGIwuVs21@kili
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Dan Carpenter 2022-07-12 17:42:12 +03:00 committed by Mark Brown
parent 4e90651e52
commit 73acfba792
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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;
}