From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18760C43458 for ; Tue, 30 Jun 2026 09:21:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/cSGQxcB2p2Gyuq3R/odzpGEXeoQPr+VuqI6gIHS/2M=; b=PLkbGw9CogUkiN7jDdyKwo4qC6 XDkXWLL2kjGKz9faOWvVHseKdHXuilqSJaIMrZQ1V16/9Sxfw0rp2ZqHfmq5u/LoGwj6hNPiw4Rc+ 6Ut6SdHzgeQbgxX84NpOJFLzZLQyCrUCXcQzeJHEdIjig9NzU6Zu/rtvcZFeHlUbrcI/7OsZfDfp7 aqwSTkabv8GMcaJR7g0FCdNvJJS+YI4pd0yBcoHBYszJxsCwJDtnpj2u2zuEM95MnjQx4jaFoXy5Y 9BbM1aEU+I3cLZh5aJIGbO1AZOjB3ov6OepANK5J8RtlwkYR7wUiwpdaphJiuOSajHa6mcYDcp4nc rkfsIrgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1weUQb-0000000GLFZ-1b1c; Tue, 30 Jun 2026 09:06:49 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1weUQT-0000000GLBo-1oa3 for linux-arm-kernel@lists.infradead.org; Tue, 30 Jun 2026 09:06:41 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id B576A60125; Tue, 30 Jun 2026 09:06:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 903271F00A3E; Tue, 30 Jun 2026 09:06:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782810400; bh=/cSGQxcB2p2Gyuq3R/odzpGEXeoQPr+VuqI6gIHS/2M=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=UG44LBcd68DmNg7+gsm6bM0OQ33wtz++vT2QmPOpV6Tk5VU2FlxadwFTxzf6SB64p nl8NBFykrcsDqQTOKGurH2Hr33vT5cyzA1oEeBiXAL4T5gCOFP11xcKPTlJ7BDK1hl IMLQxDXtMFmZcMYrtUfhUjaal0hbpF7vfHU/oQn1Jo5m1JXrVzuYELU7skoVCGeS5J jgqfy9n3xfOtQJWoSJipkrJuEEwEBWa2jG5MDHh8BCYf/ES0eQL8DqajAT6p4HvRzv Kl5vXobi/Hoa7Tvwml2qkGYkqVHbM/Yu4R0xdxMm2pOU5QSE8w39XJ6ieBHyy/9PKe R5y8s5S7l0eRw== From: Sudeep Holla Date: Tue, 30 Jun 2026 10:05:59 +0100 Subject: [PATCH 3/9] firmware: arm_scmi: Clean up channels on setup failure MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260630-scmi_core_fixes-v1-3-f932c1e51992@kernel.org> References: <20260630-scmi_core_fixes-v1-0-f932c1e51992@kernel.org> In-Reply-To: <20260630-scmi_core_fixes-v1-0-f932c1e51992@kernel.org> To: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Cristian Marussi , Sudeep Holla , Sashiko , Sudeep Holla X-Mailer: b4 0.15.2 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org scmi_channels_setup() can fail after the common BASE channel or earlier protocol channels have already been registered in the TX/RX IDRs. Route this failure through the existing channel cleanup label so the transport channels, transport devices and IDR state created before the failure are released before the probe error path frees the SCMI instance ID. Fixes: 05a2801d8b90 ("firmware: arm_scmi: Use dedicated devices to initialize channels") Reported-by: Sashiko Signed-off-by: Sudeep Holla --- drivers/firmware/arm_scmi/driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index b9ba566fc759..861087b2920e 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -3262,7 +3262,7 @@ static int scmi_probe(struct platform_device *pdev) ret = scmi_channels_setup(info); if (ret) { err_str = "failed to setup channels\n"; - goto clear_ida; + goto clear_txrx_setup; } ret = bus_register_notifier(&scmi_bus_type, &info->bus_nb); @@ -3377,7 +3377,6 @@ static int scmi_probe(struct platform_device *pdev) bus_unregister_notifier(&scmi_bus_type, &info->bus_nb); clear_txrx_setup: scmi_cleanup_txrx_channels(info); -clear_ida: ida_free(&scmi_id, info->id); out_err: -- 2.43.0