Commit e525db7e authored by Yu Kuai's avatar Yu Kuai Committed by Mark Brown

ASoC: fsl: imx-es8328: add missing put_device() call in imx_es8328_probe()

if of_find_device_by_node() succeed, imx_es8328_probe() doesn't have
a corresponding put_device(). Thus add a jump target to fix the exception
handling for this function implementation.

Fixes: 7e7292db ("ASoC: fsl: add imx-es8328 machine driver")
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20200825130224.1488694-1-yukuai3@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 68353028
...@@ -145,13 +145,13 @@ static int imx_es8328_probe(struct platform_device *pdev) ...@@ -145,13 +145,13 @@ static int imx_es8328_probe(struct platform_device *pdev)
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
if (!data) { if (!data) {
ret = -ENOMEM; ret = -ENOMEM;
goto fail; goto put_device;
} }
comp = devm_kzalloc(dev, 3 * sizeof(*comp), GFP_KERNEL); comp = devm_kzalloc(dev, 3 * sizeof(*comp), GFP_KERNEL);
if (!comp) { if (!comp) {
ret = -ENOMEM; ret = -ENOMEM;
goto fail; goto put_device;
} }
data->dev = dev; data->dev = dev;
...@@ -182,12 +182,12 @@ static int imx_es8328_probe(struct platform_device *pdev) ...@@ -182,12 +182,12 @@ static int imx_es8328_probe(struct platform_device *pdev)
ret = snd_soc_of_parse_card_name(&data->card, "model"); ret = snd_soc_of_parse_card_name(&data->card, "model");
if (ret) { if (ret) {
dev_err(dev, "Unable to parse card name\n"); dev_err(dev, "Unable to parse card name\n");
goto fail; goto put_device;
} }
ret = snd_soc_of_parse_audio_routing(&data->card, "audio-routing"); ret = snd_soc_of_parse_audio_routing(&data->card, "audio-routing");
if (ret) { if (ret) {
dev_err(dev, "Unable to parse routing: %d\n", ret); dev_err(dev, "Unable to parse routing: %d\n", ret);
goto fail; goto put_device;
} }
data->card.num_links = 1; data->card.num_links = 1;
data->card.owner = THIS_MODULE; data->card.owner = THIS_MODULE;
...@@ -196,10 +196,12 @@ static int imx_es8328_probe(struct platform_device *pdev) ...@@ -196,10 +196,12 @@ static int imx_es8328_probe(struct platform_device *pdev)
ret = snd_soc_register_card(&data->card); ret = snd_soc_register_card(&data->card);
if (ret) { if (ret) {
dev_err(dev, "Unable to register: %d\n", ret); dev_err(dev, "Unable to register: %d\n", ret);
goto fail; goto put_device;
} }
platform_set_drvdata(pdev, data); platform_set_drvdata(pdev, data);
put_device:
put_device(&ssi_pdev->dev);
fail: fail:
of_node_put(ssi_np); of_node_put(ssi_np);
of_node_put(codec_np); of_node_put(codec_np);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment