Skip to content

Commit

Permalink
soundwire: intel: fix error handling on dai registration issues
Browse files Browse the repository at this point in the history
[ Upstream commit c6867cd ]

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>
  • Loading branch information
plbossart authored and gregkh committed Oct 21, 2022
1 parent 4600500 commit 1c59cee
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/soundwire/intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,6 @@ int intel_link_startup(struct auxiliary_device *auxdev)
ret = intel_register_dai(sdw);
if (ret) {
dev_err(dev, "DAI registration failed: %d\n", ret);
snd_soc_unregister_component(dev);
goto err_interrupt;
}

Expand Down

0 comments on commit 1c59cee

Please sign in to comment.