From patchwork Mon Oct 24 11:33:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9854 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp559107wru; Mon, 24 Oct 2022 10:05:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4NN1tHICOKqZwk8rsQfQ+illLnQuOkZ/it1hLlQnS81HMSk6ij5HBtVzxT/cr/2kMw6tgA X-Received: by 2002:a17:902:eb8c:b0:186:7fb5:2143 with SMTP id q12-20020a170902eb8c00b001867fb52143mr16864807plg.30.1666631153717; Mon, 24 Oct 2022 10:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666631153; cv=none; d=google.com; s=arc-20160816; b=xj1wON191U94pN2Dvu7e42uONb50p3rtnUsUjMzQDFtuteFp7kaxnmn/WtZArQYl+D 27YPIiyCDsldcIJ2STJNo206+x35EVTe+Nex9/5Icnv50XzogmnP34b1RFCTCp25BJx+ RUwNGPDQySLuALh9+9wndb/FGQyLdmylah53FIoieZkuIVLI4NpbMYX4jr6gBhKnUftk xvTJG7kroiFsLnq8kG34ESKrNtavmOg4MB6x5Dm8escvutCPBTomSzibNxv/jAmCvwLe cI+Ssyn9+HhpJjnqGDrgRJ/R3eftMrUkIQjY+aByVE3jLYuYgAYoMiPnLHV2DumMr7uG C12Q== 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=th8jvl+/gw5bOsH2ufBmta/aJAmBtvhlju3K1GCco54=; b=XIHv+ccgvVMXzrAk5Ht2szmVznMt6cvA9D2+eeJQRXE/ozkjJ9Hor76FxKPikiWliw ebgfQVGzhUG4gijBbs/+folzK+3qEC+1GtpjKxBeXKnLJy2QkpH1kwsG10EV3LaiNrCZ HGXIXs7ETRKr3APk1ljiDf8fp9CmD+bdNg4Wo2zxIYCQbAWvJQ+MUuJV71/8YK/x1M2K I448MwWF0Wz4/zFD4V0YYI/itirEs3UlIk0GY4MfnUjKre1n+fdIl0LhrHLp3bnpDhZQ q2ya/m+fdqtxFtYJMuSJS3+rIhbHaXLzOBHbDbW0FY9IyYv/vkisx/q4HcB2Fy+bWrGv z85g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Mw9cH5Nh; 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 t4-20020a170902e84400b0017f59ed2dfasi63128plg.63.2022.10.24.10.05.40; Mon, 24 Oct 2022 10:05:53 -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=Mw9cH5Nh; 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 S234129AbiJXRDo (ORCPT + 99 others); Mon, 24 Oct 2022 13:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233391AbiJXRC5 (ORCPT ); Mon, 24 Oct 2022 13:02:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C8CC21834; Mon, 24 Oct 2022 08:39:34 -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 00C9AB818D3; Mon, 24 Oct 2022 12:54:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D3A4C433D7; Mon, 24 Oct 2022 12:54:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666616080; bh=hLGgv80zqb0eH/0rrXCcqjAM83ghk/Zxp3QBbxDGP7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mw9cH5Nhp/8rc4nzLQ5YOTyeWySFImU/UtP3aq0Nxk9Jru6z+fipGAgk17NdszSPU XOiclASn9MRJJ3jPeZcuIswoi50JeYTJzG6Oj6N1k4cL97QhLdy7sSs593wwYrAEq7 frJ4ZJtElLIPkv74piLDhsbhbl1Qy9er4ZKL8W08= 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.15 492/530] soundwire: intel: fix error handling on dai registration issues Date: Mon, 24 Oct 2022 13:33:56 +0200 Message-Id: <20221024113107.321474784@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747589428842237864?= X-GMAIL-MSGID: =?utf-8?q?1747589428842237864?= 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 38e7f1a2bb97..89ee033f0c35 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1407,7 +1407,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; }