From patchwork Mon Oct 24 11:32:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9162 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp457807wru; Mon, 24 Oct 2022 06:36:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4C68m/ZKdyFqZ6oidBNaJwcbHIJ34PqWPqRsncNt5lrWa5ndrEAxqKtfwEtP4V92OOXchH X-Received: by 2002:a63:9:0:b0:461:f0b6:759a with SMTP id 9-20020a630009000000b00461f0b6759amr28229969pga.153.1666618594058; Mon, 24 Oct 2022 06:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618594; cv=none; d=google.com; s=arc-20160816; b=u850C8+Ha8auYBiDLHV7gQizkFEJm3G21ADpi04pP6toSDPbZyfZsgx3d043VuDr3e bwdUje3yZNfpVZ0PlLsKKITXL5G0LiqweVRuqxBtgbWQq40gXX4TK5gmwKTOSczxFykE Y1GQlu5ldMofRotVMJBllQU4hMbLpd4FGhekVWebAydlVXPo1UjGzESAuXc3kNk4gCTy caAR2ut5U/wjzQKu8ne+JK/waEgGLq9ENZBmMB3BJ4t5nG0k52v8FCpgm88LEPEwPGK6 2G999KnwjTHzdRCtBkIGcps8KKkbswCTJzeYhlAOj2J13vIPtjRt08mIg1xc+Pq4u+9T kwvw== 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=/y9mpkCYtypgQv5fxqagbW7pObJRTEvpnr/Rmei1qHQ=; b=M0MiFdkHsk6U24QM4wplHpYxWMsaCNa18DfSERMowW6qB10QD1NZwNDEOGUchnTYIY rKT8SiRmAxGrPH6b+SKGe6avpdqA/Vx6J1v3PnUqQkSnNitvYz4PMIdFB7NUWG+JM+W3 nn0KZ0hkT2qezX8s2HBzhpXY4r07/yTNaSGGmpBFUxBAL3bFHwcLs1TSZl/GVdhBOQ72 NEMHpRBM0+CWORrXHgWaPHAA8qvCElgvWXc5vfOrkM2ljdv8gSW875v4s0W2kND82mec aUZP8Pgs12OUsG9iolZec93BF+FTgDoMBnENa5E5N1rlmZi+qutKtlsaRvsCkRt+mfBf AFGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ljTaymOl; 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 q82-20020a632a55000000b0046ed54becfdsi8447688pgq.30.2022.10.24.06.36.17; Mon, 24 Oct 2022 06:36:34 -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=ljTaymOl; 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 S231809AbiJXNb5 (ORCPT + 99 others); Mon, 24 Oct 2022 09:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232520AbiJXN2s (ORCPT ); Mon, 24 Oct 2022 09:28:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3F8CAA349; Mon, 24 Oct 2022 05:32:01 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5A86F6130D; Mon, 24 Oct 2022 12:31:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AFB6C433C1; Mon, 24 Oct 2022 12:31:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614709; bh=y1DBNfu6J+1iXQV3cyheZ8RvEKrcWUOykKgA/HCuzNU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ljTaymOlqSXrUTN4CpjKh+sy2yllVu5XHvdWSnWR03lNg27CnGFEf91cQYKdTDQJp TbqKN62+aVAxhTibAWQolFF6Z14HhlJ0zsON+GvgygvB9YcS4/hmkCMO43B7PRu7EG VUIU6tGk7oKIiU+DcRSziLPa8jMsx+u08+2BHA70= 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.10 365/390] soundwire: intel: fix error handling on dai registration issues Date: Mon, 24 Oct 2022 13:32:42 +0200 Message-Id: <20221024113038.546823903@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747576258980665708?= X-GMAIL-MSGID: =?utf-8?q?1747576258980665708?= 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 824d9f900aca..942d2fe13218 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1470,7 +1470,6 @@ int intel_master_startup(struct platform_device *pdev) ret = intel_register_dai(sdw); if (ret) { dev_err(dev, "DAI registration failed: %d\n", ret); - snd_soc_unregister_component(dev); goto err_interrupt; }