Skip to content

Commit

Permalink
ASoC: stm32: sai: add missing put_device()
Browse files Browse the repository at this point in the history
commit 1c3816a upstream.

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

Fixes: 7dd0d83 ("ASoC: stm32: sai: simplify sync modes management")
Signed-off-by: Wen Yang <yellowriver2010@hotmail.com>
Acked-by: Olivier Moysan <olivier.moysan@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Wen Yang authored and Greg Kroah-Hartman committed Dec 5, 2019
1 parent 86c823d commit f0b7d56
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sound/soc/stm/stm32_sai.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,21 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client,
if (!sai_provider) {
dev_err(&sai_client->pdev->dev,
"SAI sync provider data not found\n");
return -EINVAL;
ret = -EINVAL;
goto out_put_dev;
}

/* Configure sync client */
ret = stm32_sai_sync_conf_client(sai_client, synci);
if (ret < 0)
return ret;
goto out_put_dev;

/* 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)
Expand Down

0 comments on commit f0b7d56

Please sign in to comment.