Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp900322rwi; Wed, 19 Oct 2022 04:30:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ZEjKciaJyRTr99hKw6xJ7VFPr7oEuewYvfg2oSFgeLLeR+b7tZjYJA8E+u3B5I8lvfnEM X-Received: by 2002:a17:90b:3e86:b0:20d:ab3e:bc50 with SMTP id rj6-20020a17090b3e8600b0020dab3ebc50mr9237712pjb.53.1666179059037; Wed, 19 Oct 2022 04:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666179059; cv=none; d=google.com; s=arc-20160816; b=pXOB+Zo//O7bg14LuCeaH40emLyYhToFUKQjrBR0NwinXUajAFgLFDbV6ygINWHX1Q oGnolixiH76TDEt9n1yawrPoJ8VM//VHdNw63J8f1WnY8d2INUfmoOeKKNbf90VwqMKI 0A00dQZ9eCrqH3IEXT8i/VyACxFthkO9qSgfANZkV2geZLEKxeF0BV6YPU9rgvk91bKh tbIW0WVPQLT8lSjz2SA5DO7Ls1R5kep5ICXiNQUUpgLaGJwluJbtS5XllZ6VVxf4jkm4 cjMSUUKBEdAhngWRU5XwVLXjrb1nZhwahljHdv/xaTChWHu9RU+qSM7V0nOYssnyBLGc ldNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WJ4LsgIQWHhLIB0d5A9eJdg94sCUsF9Lg9Mc9tv+mIg=; b=qIu/srGqLwVk6IRFHQuV2JeB6l/K3u3nFa+XB9OgBzGx6arX4jVizDg11+GH557Ima TIxp30K0/W/Hml9NqPz21uZop45/iTWmtliG6JQfo9UGDQCLpa980pfhKC0zvMpBifl4 ImPIDAxA4TThv90o0MMZMImbwPEnI/YAiErLsX4PIMcqaVpjBRD/8/+gtTQk09F2D4Y5 +gRNP7x2KrrVRa4KDGqDn7eELTuf3tgstaLj1VD885QiONe1Y7lvT8rakz2CRfrg14+/ 6HwyUi+ivYXNWxhc347t8xFWevyVOdfiZMDzVupvSbgYaKKQzU9EcwIelfQXWlYmTTkb 99Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N2L4P1zC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d21-20020a056a00199500b00563b7ea2d7fsi19722284pfl.144.2022.10.19.04.30.44; Wed, 19 Oct 2022 04:30:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=N2L4P1zC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231687AbiJSKhM (ORCPT + 99 others); Wed, 19 Oct 2022 06:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbiJSKgk (ORCPT ); Wed, 19 Oct 2022 06:36:40 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF68D10DC; Wed, 19 Oct 2022 03:15:30 -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 sin.source.kernel.org (Postfix) with ESMTPS id 8AA98CE21BF; Wed, 19 Oct 2022 09:14:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AB8CC43470; Wed, 19 Oct 2022 09:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170856; bh=W5Sm+YPQ1xjDU381TURqrY9sM8XImPQc4XQ4uSH9l5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N2L4P1zCKlzNkaWyAP4hlb85oFJRIGpRK9ZY5KXxuVJKMiFdTThqgwnp60Pc2u1JO M1Spxf855SAqAkEj5V4Jr7z4h1FvkBup8mQfwQ2/FTC8VjgO4mWoEJw+Cl+KY443Tb /n4zDJ7rBHNLNUM6vqglQomJKQldXLWZ0iapH6tg= 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 6.0 811/862] soundwire: intel: fix error handling on dai registration issues Date: Wed, 19 Oct 2022 10:34:58 +0200 Message-Id: <20221019083325.756535639@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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@linux.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 89d1d0d021fc..af6c1a93372d 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -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; } -- 2.35.1