diff options
author | Olivier Moysan <olivier.moysan@st.com> | 2019-02-28 14:19:25 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-03-03 23:40:13 +0000 |
commit | d4180b4c02e7b04b8479f6237b2bd98b4c5fd19c (patch) | |
tree | 0a34bd6312db8145f77ec23557dd09faece26c51 /sound/soc/stm/stm32_sai.c | |
parent | 71d9537fada47762a1a1b33a8a1f95a92d7edc11 (diff) | |
download | talos-op-linux-d4180b4c02e7b04b8479f6237b2bd98b4c5fd19c.tar.gz talos-op-linux-d4180b4c02e7b04b8479f6237b2bd98b4c5fd19c.zip |
ASoC: stm32: sai: fix set_sync service
Add error check on set_sync function return.
Add of_node_put() as of_get_parent() takes a reference
which has to be released.
Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/stm/stm32_sai.c')
-rw-r--r-- | sound/soc/stm/stm32_sai.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c index 14c9591aae42..d68d62f12df5 100644 --- a/sound/soc/stm/stm32_sai.c +++ b/sound/soc/stm/stm32_sai.c @@ -105,6 +105,7 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client, if (!pdev) { dev_err(&sai_client->pdev->dev, "Device not found for node %pOFn\n", np_provider); + of_node_put(np_provider); return -ENODEV; } @@ -113,19 +114,20 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client, dev_err(&sai_client->pdev->dev, "SAI sync provider data not found\n"); ret = -EINVAL; - goto out_put_dev; + goto error; } /* Configure sync client */ ret = stm32_sai_sync_conf_client(sai_client, synci); if (ret < 0) - goto out_put_dev; + goto error; /* Configure sync provider */ ret = stm32_sai_sync_conf_provider(sai_provider, synco); -out_put_dev: +error: put_device(&pdev->dev); + of_node_put(np_provider); return ret; } |