From patchwork Sat Oct 22 07:29:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7690 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1109111wrr; Sat, 22 Oct 2022 01:47:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7/TSaAJvJGazROAnFyY8bUTCE+C+af+zvGX0pRhV6y4yolCS5j7N8yXVXevttDuqEHOJli X-Received: by 2002:a05:6402:2791:b0:45d:3a94:3494 with SMTP id b17-20020a056402279100b0045d3a943494mr21010284ede.91.1666428438126; Sat, 22 Oct 2022 01:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666428438; cv=none; d=google.com; s=arc-20160816; b=jGbrjgaXybiHoQDEsL2Jp5taRTuNp2zpb1HZXbvi+2F9efEnkvUPBMgJ+FhSvvZmBl SC7fUhAzxeRtYgaNEVDhJqG+eGMRmkf6ShpyGDpVwjtGTcOGBV/oj0tWv9Z/zCejatfL AlMUuDfGJFUBX+4tSH97fDYoehfKFNMe+1TwvbxyXBEiTjeTooUzoNzdy2EbNKd1N3Bj 5cJwbOCJYWU4wiKMoKGQ/2g6NvCigmRJxvMM62bBYVpkBfUDkTHv4j8W1ijGNR6Be3qX tkWrqyMrDPe7xhobPiZkrSpIOMmzow3q+WvznQspRCKwSgiHz8arKC27baRtaWS5AARJ 1zTw== 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=/KEHr116Y/UJP7Jpz4xy6Bt1+vShjV+4HPr0IIAuhxQ=; b=Hp1Ff84yp1xTLBjQ8PCY5a7yKnAiF00ETXjZ6ZDlxjR74+w5zIgOKIdkFD0E5NAKGv 7fTUpGv2ZoFmB8LuUkrPhlqrqgu1SB5gCTb3RarGzDC26fpiUVerRFExJZxQP+BiFGGe EziE1H/yXVO40P9KloL8rvlH4ZSQjYGELomokV0+hKKI9GS/DQjpTpJ33pKWi+Oyqe1J QqSWbd7SnZpY25SERv9wQ8+oMgVPXzvYTOti66cjqh5ppsmowfo4a/Pdk7jmBg+ctxI9 /WyED/yWNagYFdH6dBKRbl+v+sKhabydThJEM0pThOyaK1526IPkf+lMY/hQamvAVCZJ HqBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0o7674sL; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ee32-20020a056402292000b00458ec94d128si4367628edb.513.2022.10.22.01.46.53; Sat, 22 Oct 2022 01:47:18 -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=0o7674sL; 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 S234566AbiJVIqG (ORCPT + 99 others); Sat, 22 Oct 2022 04:46:06 -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 X-Spam-Status: No, score=-7.3 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376866282424192?= X-GMAIL-MSGID: =?utf-8?q?1747376866282424192?= 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 505c5ef061e3..865d91ecb862 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1401,7 +1401,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; }