Article View: linux.kernel.netdev
Article #26321[PATCH v5 09/33] ALSA: usb-audio: Release interface claims when probe fails
From: Leon Romanovsky
Date: Thu, 03 Dec 2026 12:03
Date: Thu, 03 Dec 2026 12:03
39 lines
9581 bytes
9581 bytes
From: Leon Romanovsky <leonro@nvidia.com>
If the first control-interface probe fails after claiming streaming or
MIDI interfaces, freeing the card leaves those claims behind. Module
unload can then race with registration of the claimed interfaces and
leave dangling driver pointers.
Release auxiliary claims when discarding a newly created card. Preserve
them when a failed secondary probe leaves an existing card in use.
Fixes: 9ad3d6ccf5ee ("[PATCH] USB: Remove USB private semaphore")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
sound/usb/card.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 59979b793fe9..56ebdd61f72e 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -1090,6 +1090,13 @@ static int usb_audio_probe(struct usb_interface *intf,
atomic_dec(&chip->active);
if (!chip->num_interfaces) {
usb_audio_disconnect_components(chip);
+ for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
+ struct usb_interface *iface = dev->actconfig->interface[i];
+
+ if (iface->dev.driver == &usb_audio_driver.driver &&
+ usb_get_intfdata(iface) == USB_AUDIO_IFACE_UNUSED)
+ usb_driver_release_interface(&usb_audio_driver, iface);
+ }
snd_card_free(chip->card);
}
}
--
2.56.1
Technical Details
Message-ID:
<20261203-device-trust-core-v5-9-485cc6eddd46@nvidia.com>Path:
mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376543-linux-kernel-netdev=dewy.ruReferences:
<20261203-device-trust-core-v5-0-485cc6eddd46@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376543-linux-kernel-netdev=dewy.ru From: leon@kernel.org (Leon Romanovsky) Newsgroups: linux.kernel.netdev Subject: [PATCH v5 09/33] ALSA: usb-audio: Release interface claims when probe fails Date: Thu, 3 Dec 2026 14:03:31 +0200 Organization: Usenet Network Message-ID: <20261203-device-trust-core-v5-9-485cc6eddd46@nvidia.com> References: <20261203-device-trust-core-v5-0-485cc6eddd46@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2480079"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:wPI9eqcuokorn+QqQNFdtJLTZKg= sha256:pJ/MxczjMef2OnEPMlK8giNAbiMB1bRK/1dpd5gGSHo= sha1:IwdccjNdC5DILnKqJNDzE7/B9s8= sha256:bsFi0cYDq3HtBwAYkqUN6COLrEXqJ9Rto4rAOLVNAbw= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 90077117908; Thu, 3 Dec 2026 15:06:00 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.64 X-Spam-Status: No, score=-2.64 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GyIWwW0231vd; Thu, 3 Dec 2026 15:05:58 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-376543-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 86616117904; Thu, 3 Dec 2026 15:05:47 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 056B3603A2E; Thu, 3 Dec 2026 12:05:47 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796299479; b=MccJbhjJcUtsmpfGNyh3ubjtV3Arb9VdTcupX/3oOuY5JkmgXJy10BdInSURhJHBHrSK pVEaB6gWJjoBipAaYAp+Gu0aBa5SbQonPKZ8t8bvG9pKBjqP0rd4Am2yepwVdp49Bz2gz lTFIcqcn3gUUZ5G06TnqeGjspvl89zFaf76wxQJZwBfNERyVO2WUHZCFXTfbxk/CQbqr2 xJqLviGy0Cgz/ELixBtvg7K7ULoAn3J6TPZT8Fj8Hj5PAFwmBQ7DaOwAbwMb9BC5csThX VrIIqik15exhsRy5k478E/jcg7LD495p2LKP/CE/7BdzKfT2yymE1spZYLe/mSA3d5A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796299479; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List: List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe: List-Owner:Precedence:MIME-Version:Content-Type:X-Mailer: Content-Transfer-Encoding; bh=yzzw/V7grN8jZc8lzn6DA77xmE2zrOZZVKyOm9TQrkY=; b=XbaqOHDcZTW048UivpzInLoBJ2mh856X49xqSJ5+pmKi/1tOymuFqxjWF1UyJ4PaqpZa mUipxWkmu1qTftwf54snvY7bV1CX41d0N2vHAkFRLIG2Q7ndVbuOyYVS8TFxjtXopBl0o v7T/HdmACSTheAVWdYPVxYSJ8Qlo68RuV3VBH7ogGcVIICMd0vUYxn1BurD85pzh5rojO XLJcUBptJLXa4TgUa2q33YCM550fqpLuhiw60JDdtnbyUW30l5gR8JLHAMpRp5yTXOIp/ 4a3WViuW45Ls6BuMaLt0YPOOKs5zwje8XVeYC0G/XlMd98wbMzgV96eDM4VfQECCs8w== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fN20O7K+; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7DD46606BCFA; Thu, 3 Dec 2026 12:04:39 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fN20O7K+ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796299468; b=iCTnURKTIkEetSXscckfWUV6liQ/HTpWzWd5aYODQfVnAyO9wwv+c0TAV19jc9YGvV+X +As1davYex3XAZvmimm/r0HZuzYVVCsuN3AC3W9lx+J+yT3I7gi94SiPL8CDHCpGUWaxc aMhRS6GcXay93kE3uYPfSF7dV1NdCpwt8YEG3L5gRfSsJUMEtdW2po6hsKKHICAQ075ZU BwhOG++pCIxK7I4uqsI83ZBk0Aaf3w0QraNGpQnVU6MkZAYzwwW0MoIm/zuDlsNyv8mWe IqrUw91vSKcTLWvsybKuYh/+0bMbxiVKBROd7q4UoMavO4jVcLGzRXziaDNC3BPB4Wg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796299468; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type:X-Mailer: Content-Transfer-Encoding; bh=yzzw/V7grN8jZc8lzn6DA77xmE2zrOZZVKyOm9TQrkY=; b=aKjxRAWFbYSPHNOW1Zkx0XtJPStpWVzxSHrQoSpPjbndxWWrl9GEZO1+V/eWoikdAVpI rYOIjvIe/WtEX+CY58+RVmRXgD3g/nltRyl3FcovIr5x+2uYfA+eawmzdC/I1kmSwH6Ig gRmH5QEDBCY688Dy6x79UGSBHwtyIFEzlINmZgActZMdTXGAU4VpNptpgfCC2XgsHNuu+ FbUrtYJVOLW61w8HPjnVIcYdspP8Rva5NfgAiIUVffFOVdq5nr336FRxeHf/Vfx9W6ryy YmA5vr4cK2kQ9YzBpqp0UdXXXaMf623M1pgybyi6t0rOQprUQYz21FZPkP2RUiJ5IpQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fN20O7K+; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96F84606A695; Thu, 3 Dec 2026 12:04:28 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65FA41F000C1; Thu, 3 Dec 2026 12:04:27 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796299468; bh=yzzw/V7grN8jZc8lzn6DA77xmE2zrOZZVKyOm9TQrkY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fN20O7K+h59oD9ggHa64vkBGIb8ECcRZShHg0Eej5MciRwMsEwUbNEMEr2b2stJAC 4WJB6y6kkEQ7IUcsZC+2KYcxV7PCAZLYVgdhcPA8w4WVc6X0AH5BNqSPIp1AVQKmaF UGnwF5zmUwwotGyS2+4bswZ+9r8jJrAbsO1m/rh8tyoU4lBtSI/8okG/3jgE7mP3a+ 4uVB2gtf7qF+N18fAn9Xt+SKGgKf00DmcaQjs/rwt2/ZskW+5ssRYVGMftTTYB7IlV INNDPaCB1cOm1IbAfX+j5g2Krh1R8m43HGS3vcR4AJfh8TWGpv78i9+hRHEPpmcrPX 9F66Ho4imRFuQ== X-Cc: linux-kernel@vger.kernel.org, driver-core@lists.linux.dev, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-usb@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, iommu@lists.linux.dev, linux-coco@lists.linux.dev, Alexey Kardashevskiy <aik@amd.com>, Luiz Augusto von Dentz <luiz.von.dentz@intel.com>, Greg Kroah-Hartman <gregkh@suse.de>, linux-sound@vger.kernel.org, Jason Gunthorpe <jgg@ziepe.ca>, Takashi Iwai <tiwai@suse.de> X-Mailer: git-send-email 2.56.1 X-In-Reply-To: <20261203-device-trust-core-v5-0-485cc6eddd46@nvidia.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-Mailer: b4 0.17-dev-d2b70