soundwire: intel: fix error handling on dai registration issues
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 19 Sep 2022 17:57:11 +0000 (01:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:48 +0000 (12:35 +0200)
commitf7f425d61de9bd5812fcf399888b7275afb97b58
tree2709f1d35e0842086805735c491a4eba397b97d4
parent093a5463aeecc8a8d13bac233652cf6532d53dd7
soundwire: intel: fix error handling on dai registration issues

[ Upstream commit c6867cda906aadbce5e71efde9c78a26108b2bad ]

The call to intel_register_dai() may fail because of memory allocation
issues or problems reported by the ASoC core. In all cases, when a
error is thrown the component is not registered, it's invalid to
unregister it.

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/20220919175721.354679-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soundwire/intel.c