diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2022-01-26 09:16:58 +0800 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2022-02-11 12:15:36 +0530 |
commit | 823ca8853d6074bb70995d08104930b30cf38f55 (patch) | |
tree | d50cb6fcf30f221774103c4a2f31eb839925c48c /drivers/soundwire | |
parent | ad027fa2986661708b7bb668d984d499dd5aed89 (diff) |
soundwire: stream: add slave runtime to list earlier
sdw_config_stream() only verifies the compatibility between
information provided by the Slave driver and the stream configuration.
There is no problem if we add the slave runtime to the list earlier.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220126011715.28204-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire')
-rw-r--r-- | drivers/soundwire/stream.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index a30d0fb4871b..a75d3576bfcf 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -1373,20 +1373,11 @@ int sdw_stream_add_slave(struct sdw_slave *slave, ret = -ENOMEM; goto stream_error; } + list_add_tail(&s_rt->m_rt_node, &m_rt->slave_rt_list); ret = sdw_config_stream(&slave->dev, stream, stream_config, true); - if (ret) { - /* - * sdw_release_master_stream will release s_rt in slave_rt_list in - * stream_error case, but s_rt is only added to slave_rt_list - * when sdw_config_stream is successful, so free s_rt explicitly - * when sdw_config_stream is failed. - */ - kfree(s_rt); + if (ret) goto stream_error; - } - - list_add_tail(&s_rt->m_rt_node, &m_rt->slave_rt_list); ret = sdw_slave_port_config(slave, s_rt, port_config, num_ports); if (ret) |