mirror of
https://github.com/torvalds/linux.git
synced 2024-12-02 00:51:44 +00:00
Merge series "ASoC: codecs: rt*-sdw: memory leaks and simplifications" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
While debugging unrelated memory corruption errors, I detected issues
related to the interaction with the SoundWire and ASoC cores, here are
3 small patches to fix all this.
Pierre-Louis Bossart (3):
ASoC: codecs: rt*-sdw: don't assign slave_ops
ASoC: codecs: rt*-sdw: fix memory leak in set_sdw_stream()
ASoC: codecs: rt1308-sdw: remove duplicate allocation
sound/soc/codecs/rt1308-sdw.c | 11 +++--------
sound/soc/codecs/rt5682-sdw.c | 3 ---
sound/soc/codecs/rt5682.c | 3 +++
sound/soc/codecs/rt700-sdw.c | 3 ---
sound/soc/codecs/rt700.c | 3 +++
sound/soc/codecs/rt711-sdw.c | 3 ---
sound/soc/codecs/rt711.c | 3 +++
sound/soc/codecs/rt715-sdw.c | 3 ---
sound/soc/codecs/rt715.c | 3 +++
9 files changed, 15 insertions(+), 20 deletions(-)
base-commit: d731c1a0f9
--
2.20.1
This commit is contained in:
commit
a1c3ec70ee
@ -178,10 +178,6 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
|
||||
if (rt1308->hw_init)
|
||||
return 0;
|
||||
|
||||
ret = rt1308_read_prop(slave);
|
||||
if (ret < 0)
|
||||
goto _io_init_err_;
|
||||
|
||||
if (rt1308->first_hw_init) {
|
||||
regcache_cache_only(rt1308->regmap, false);
|
||||
regcache_cache_bypass(rt1308->regmap, true);
|
||||
@ -282,7 +278,6 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
|
||||
|
||||
dev_dbg(&slave->dev, "%s hw_init complete\n", __func__);
|
||||
|
||||
_io_init_err_:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -482,6 +477,9 @@ static int rt1308_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
|
||||
{
|
||||
struct sdw_stream_data *stream;
|
||||
|
||||
if (!sdw_stream)
|
||||
return 0;
|
||||
|
||||
stream = kzalloc(sizeof(*stream), GFP_KERNEL);
|
||||
if (!stream)
|
||||
return -ENOMEM;
|
||||
@ -684,9 +682,6 @@ static int rt1308_sdw_probe(struct sdw_slave *slave,
|
||||
{
|
||||
struct regmap *regmap;
|
||||
|
||||
/* Assign ops */
|
||||
slave->ops = &rt1308_slave_ops;
|
||||
|
||||
/* Regmap Initialization */
|
||||
regmap = devm_regmap_init_sdw(slave, &rt1308_sdw_regmap);
|
||||
if (!regmap)
|
||||
|
@ -241,9 +241,6 @@ static int rt5682_sdw_probe(struct sdw_slave *slave,
|
||||
{
|
||||
struct regmap *regmap;
|
||||
|
||||
/* Assign ops */
|
||||
slave->ops = &rt5682_slave_ops;
|
||||
|
||||
/* Regmap Initialization */
|
||||
regmap = devm_regmap_init_sdw(slave, &rt5682_sdw_regmap);
|
||||
if (IS_ERR(regmap))
|
||||
|
@ -2935,6 +2935,9 @@ static int rt5682_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
|
||||
{
|
||||
struct sdw_stream_data *stream;
|
||||
|
||||
if (!sdw_stream)
|
||||
return 0;
|
||||
|
||||
stream = kzalloc(sizeof(*stream), GFP_KERNEL);
|
||||
if (!stream)
|
||||
return -ENOMEM;
|
||||
|
@ -450,9 +450,6 @@ static int rt700_sdw_probe(struct sdw_slave *slave,
|
||||
{
|
||||
struct regmap *sdw_regmap, *regmap;
|
||||
|
||||
/* Assign ops */
|
||||
slave->ops = &rt700_slave_ops;
|
||||
|
||||
/* Regmap Initialization */
|
||||
sdw_regmap = devm_regmap_init_sdw(slave, &rt700_sdw_regmap);
|
||||
if (!sdw_regmap)
|
||||
|
@ -860,6 +860,9 @@ static int rt700_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
|
||||
{
|
||||
struct sdw_stream_data *stream;
|
||||
|
||||
if (!sdw_stream)
|
||||
return 0;
|
||||
|
||||
stream = kzalloc(sizeof(*stream), GFP_KERNEL);
|
||||
if (!stream)
|
||||
return -ENOMEM;
|
||||
|
@ -450,9 +450,6 @@ static int rt711_sdw_probe(struct sdw_slave *slave,
|
||||
{
|
||||
struct regmap *sdw_regmap, *regmap;
|
||||
|
||||
/* Assign ops */
|
||||
slave->ops = &rt711_slave_ops;
|
||||
|
||||
/* Regmap Initialization */
|
||||
sdw_regmap = devm_regmap_init_sdw(slave, &rt711_sdw_regmap);
|
||||
if (!sdw_regmap)
|
||||
|
@ -906,6 +906,9 @@ static int rt711_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
|
||||
{
|
||||
struct sdw_stream_data *stream;
|
||||
|
||||
if (!sdw_stream)
|
||||
return 0;
|
||||
|
||||
stream = kzalloc(sizeof(*stream), GFP_KERNEL);
|
||||
if (!stream)
|
||||
return -ENOMEM;
|
||||
|
@ -525,9 +525,6 @@ static int rt715_sdw_probe(struct sdw_slave *slave,
|
||||
{
|
||||
struct regmap *sdw_regmap, *regmap;
|
||||
|
||||
/* Assign ops */
|
||||
slave->ops = &rt715_slave_ops;
|
||||
|
||||
/* Regmap Initialization */
|
||||
sdw_regmap = devm_regmap_init_sdw(slave, &rt715_sdw_regmap);
|
||||
if (!sdw_regmap)
|
||||
|
@ -530,6 +530,9 @@ static int rt715_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
|
||||
|
||||
struct sdw_stream_data *stream;
|
||||
|
||||
if (!sdw_stream)
|
||||
return 0;
|
||||
|
||||
stream = kzalloc(sizeof(*stream), GFP_KERNEL);
|
||||
if (!stream)
|
||||
return -ENOMEM;
|
||||
|
Loading…
Reference in New Issue
Block a user