From nobody Fri Dec 19 18:42:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CCFDC04A95 for ; Sat, 22 Oct 2022 08:46:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234410AbiJVIqI (ORCPT ); Sat, 22 Oct 2022 04:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234895AbiJVIn7 (ORCPT ); Sat, 22 Oct 2022 04:43:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48E2D2EA29C; Sat, 22 Oct 2022 01:07:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5CB53B82E1D; Sat, 22 Oct 2022 08:05:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF2DFC433C1; Sat, 22 Oct 2022 08:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425949; bh=W+yRkhVnvuDn6P4WhQFBQd4IV6hCCgQ3Bo73XUYdjqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0o7674sLU8rxZBGDRjx6Igvwu+VmWakCzElqIJRdeA7AGRIpe5aETpSfoN3iiKf7H 0nqAAknjtlZn4Z+m3+oiNepSSBtbzh/MWOCE7j9wDwcGMhuBGAQ1BtGS4qP9U0FVWf mQOjeCklitGQoFq5n6zaO2Mq/YL0DtyXaORGepvc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Louis Bossart , Rander Wang , Bard Liao , Vinod Koul , Sasha Levin Subject: [PATCH 5.19 669/717] soundwire: intel: fix error handling on dai registration issues Date: Sat, 22 Oct 2022 09:29:08 +0200 Message-Id: <20221022072528.010061771@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Pierre-Louis Bossart [ 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 Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20220919175721.354679-2-yung-chuan.liao@lin= ux.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/soundwire/intel.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 505c5ef061e3..865d91ecb862 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1401,7 +1401,6 @@ int intel_link_startup(struct auxiliary_device *auxde= v) ret =3D intel_register_dai(sdw); if (ret) { dev_err(dev, "DAI registration failed: %d\n", ret); - snd_soc_unregister_component(dev); goto err_interrupt; } =20 --=20 2.35.1