Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp134642rwi; Wed, 12 Oct 2022 17:21:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Tj4ERt7ecNdcxnoRt+eK4D8Ni02tPu+BFFG5Yau3QbisfmijbuV/lkCiapSiCeuFRJsGV X-Received: by 2002:a17:907:1dc7:b0:78d:c153:d64a with SMTP id og7-20020a1709071dc700b0078dc153d64amr11997064ejc.429.1665620497666; Wed, 12 Oct 2022 17:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665620497; cv=none; d=google.com; s=arc-20160816; b=CiCrpx4++H1WwmEcoKFb0AKrYMpOXh5fSyG8w419Fq0Vd8mQnUCcjK9I4O3Jrxwzyt tTGHoSDqulLfpcOU8U6MDsZyZAmUT99Xp7wB8uV5gQIuormDoq6WSQZ6uS7W7pf8hX1E OAdE5ZosuJ9ZILb0ksXBNG6FwgesktnR/g5eXP0oVSBj0Y8GVtMXyyNx5CGeykZXcxdA fkgd/WQEGBKSUlNt+eZlN2WnbX1okeKe44676+/ZkH7YUvCDe1jIEqPz7hM6PLY3FTHm CR5XyYJG9NaWhTFA6u6YjoiYUUXqGGy3movKEyq9Vg312+oQgsT66z5uL7CIkWTV1RJu COrA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WJ4LsgIQWHhLIB0d5A9eJdg94sCUsF9Lg9Mc9tv+mIg=; b=nPYiVYZdMaCR3DT4iKPsey1LxfZi+Uq6IzCq3wo5vokXV6hECCc+WOVCQpZvuUgpeF Jxhryo/0U5ZrGi8HAHGh7BagXca+NN26MQ++OxJiXhVWBnpXpNBsM5XtGdDC5dnuJuJQ PovgvQXYIY/LrQOrcvZ9lp0WrJRvLRDOJLj9NPq41Bjh7E194uM8bWzjFMde7I6a43bq U2RaJy+jMxq8OImPbmaHbRBX0kECzN0Vf1FMNhHSURV0DIKWs2pOHcD5I0sODU1aPkZd ryc9pE0Nj9t1jgM+bL44taMHJ8cfx38l0fg5u9acMWXXL2ku+PJRPkMUZ3suzYP/YiiM 46kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aYkj3RG9; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn9-20020a1709070d0900b00783645da4e5si5972294ejc.582.2022.10.12.17.21.12; Wed, 12 Oct 2022 17:21:37 -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=@kernel.org header.s=k20201202 header.b=aYkj3RG9; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229862AbiJMATS (ORCPT + 99 others); Wed, 12 Oct 2022 20:19:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230047AbiJMASb (ORCPT ); Wed, 12 Oct 2022 20:18:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3379515E0D4; Wed, 12 Oct 2022 17:17:19 -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 F3A95B81CCD; Thu, 13 Oct 2022 00:17:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDE46C433D7; Thu, 13 Oct 2022 00:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620224; bh=W5Sm+YPQ1xjDU381TURqrY9sM8XImPQc4XQ4uSH9l5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aYkj3RG9Ad4ah14AdBRD+0fCP49I8Wj6pUaBI3uwhosvD8OIli6sPu0kIxdy156y5 hlrLEzb9hpZs6/uFBf1kFYJv1Q0hxoyZWxiweECweVI9w9M0SvhMfB3HYgdv3FUepv YWxYNwQMvBWy4A29+rDeRJQqiZ/qnkd2ApUDmDRMDG3S84ur9FXykQuCUyoVZxb5P/ S5OVbD/sVRPeA+sjTw8j+7KWQIIJG33eEb0vv/WnT6d8GJEQ4FyfQKDV4BmBY4wfAn Xm5EEdGhIXh8gbUgueanutZ6tkFY31FAA2MngT/xmE2uMqSOq8ZQQU2EBi6MxL/F/4 eeTvbTOpiGpGA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pierre-Louis Bossart , Rander Wang , Bard Liao , Vinod Koul , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 6.0 29/67] soundwire: intel: fix error handling on dai registration issues Date: Wed, 12 Oct 2022 20:15:10 -0400 Message-Id: <20221013001554.1892206-29-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013001554.1892206-1-sashal@kernel.org> References: <20221013001554.1892206-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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