Commit f0b7d56f authored by Wen Yang's avatar Wen Yang Committed by Greg Kroah-Hartman

ASoC: stm32: sai: add missing put_device()

commit 1c3816a1 upstream.

The of_find_device_by_node() takes a reference to the underlying device
structure, we should release that reference.

Fixes: 7dd0d835 ("ASoC: stm32: sai: simplify sync modes management")
Signed-off-by: default avatarWen Yang <yellowriver2010@hotmail.com>
Acked-by: default avatarOlivier Moysan <olivier.moysan@st.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 86c823d4
...@@ -112,16 +112,21 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client, ...@@ -112,16 +112,21 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client,
if (!sai_provider) { if (!sai_provider) {
dev_err(&sai_client->pdev->dev, dev_err(&sai_client->pdev->dev,
"SAI sync provider data not found\n"); "SAI sync provider data not found\n");
return -EINVAL; ret = -EINVAL;
goto out_put_dev;
} }
/* Configure sync client */ /* Configure sync client */
ret = stm32_sai_sync_conf_client(sai_client, synci); ret = stm32_sai_sync_conf_client(sai_client, synci);
if (ret < 0) if (ret < 0)
return ret; goto out_put_dev;
/* Configure sync provider */ /* Configure sync provider */
return stm32_sai_sync_conf_provider(sai_provider, synco); ret = stm32_sai_sync_conf_provider(sai_provider, synco);
out_put_dev:
put_device(&pdev->dev);
return ret;
} }
static int stm32_sai_probe(struct platform_device *pdev) static int stm32_sai_probe(struct platform_device *pdev)
......
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