Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1880941lql; Wed, 13 Mar 2024 10:38:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVb3rmHoTLbhqqyeD8XO1smKL7LTv6gaEZhK/l/90nCAPXarx/yRbdAjNtU1ZKlD6I0gSfU/EAx9rnT2p1OihSqHvRwPrrASqjGVASHgQ== X-Google-Smtp-Source: AGHT+IFmVLVjrflavJQgG/GX+V4CtkVmfbVWfla9grKjPf/AWAABpQoB+SJuVuPpVkQWAvy4ATLE X-Received: by 2002:a05:6358:701:b0:17b:f464:e14b with SMTP id e1-20020a056358070100b0017bf464e14bmr743750rwj.13.1710351499060; Wed, 13 Mar 2024 10:38:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710351499; cv=pass; d=google.com; s=arc-20160816; b=B8ndwg3gMn9VYr3Nngfr9Hq56/jInZDZP2chlu4uHd8+IwSRv6VSAupO5ukFPm784Y 2WF7rlyvgILlV9m+dk6qErb4fS0tPJlnHv9l9uMB8Gmh3/YSSniVRgzVi+o1cvt3BaAv 37f835ljp7GyUT3PYZUJTuJd141KY1hWCcwFbzW//0veOAxYOm6T2wPH+nC8eLvb4/ux EbwnzpHUlU/pCvW84wMXWlVzX02VS20Z694boglWEZmqY9PLZ5xlxR2oL/ptw/rAFGIG mUOy7h1qAv0dQKVSW2I7goYKPiNCIfUj2Pl3jjchZT/GUazmhxR+Zx1deeZcZIaF7guY 7vjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kMSOyI9Vp2sYFIkTFq09uia/4utnsA2PM/+SgCGEhxU=; fh=gGZph1fDPNgIXep+cF7MdUivbltszX1VGZsZ/6sY7Lg=; b=FexIV3fqVxjqUydFdxdmKT2JSlac8pJjA0nkWMsxPN2uRqTGcXdI75uDVFXskQcsn4 jVafTNeOwRz9ug5HWg7vCLUwnLrIaAMJipYCn0X7h+BAHcrzynHJ2hineFhkcQvBDHII rVAyJMd8u/ekoU+4BHtIH3skWcd0AkLtf5Fk9ZrYqCxzBU1V0oVnG4XRCxjqcDlr3zen jg3NaTEUUP/GP4XKh4o3brWFEEuTilI9QEv46WjJzVbyJHWoAMAQcqXFY6SrsCxUJjIm Oe3/hf74dPcQRkGHrQwdcbTlTBhTKsbrHpEd04U90O9UE1HFx8HAOKsHb2gxik6P8GvZ DhlQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EPt16zyY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-102010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b12-20020a631b0c000000b005dc85a7eb1dsi9368446pgb.299.2024.03.13.10.38.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:38:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EPt16zyY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-102010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102010-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CE33228331E for ; Wed, 13 Mar 2024 17:37:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E9F7634FB; Wed, 13 Mar 2024 16:43:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EPt16zyY" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8B5A14D444; Wed, 13 Mar 2024 16:43:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348224; cv=none; b=i1bwl8rQ+xL/NyawDqB7BmRfUVGfP/MeYclsYtsA8jA94hMLZeD6tim21EoyUafPWMCTWhBMj4sXM71E+IlIEgKZUNVjCcCcYkNzDHJSsQPgYm3BXcnQ/he25XPXE/f5ekDBQCuOyPv91/GLGGkytfI7qO2htN5Q5lE+tcZPJtg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348224; c=relaxed/simple; bh=s8SnMuojUTopw8S4/MfbR5xT0i36Z9rfYwSR7D7R1wQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OJVCcQX7vF58WPczAyWLPnSaczW2WGmobHO8BSp0SRqO4r+3aQ+b9+lshMW0LeREN8fnMwGxSyF7XO9D8GbMLNP2dUbmzIIIRh/RAD2FcV/sRKKhPpCYTh3Y1rXcdqC14Cnzb6sh1efRxE9ZMbQawJ3Pb9pGBoSt9ik228B3mtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EPt16zyY; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90B2FC43390; Wed, 13 Mar 2024 16:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348223; bh=s8SnMuojUTopw8S4/MfbR5xT0i36Z9rfYwSR7D7R1wQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EPt16zyY9P3F5r+J/f5LStTkzPfGqXmqxcl/XtMlqdyza3F/waI+D3vm02Yu1WUwR 21KZHb/TQx39szIm64bYBK9u8wIDzY2USsUyInm9nXmFVSBDsTRoMiA7dCL7ajJHPo dfHMCg+qMHI/yDlL6uvDuIsl7mxqpdzrOvc4pfjm9pQ6fBm6LNPNcA72JVp6D/B5Kw PI1GHisl53cWpc5nYdLHaWeRi2Pvcb9CFTG1m0KTT7BfaRp+BtMwvR9svhFAS4+Wla bTX4Zl9aSk07ERwAXSBy54F2uK/7UP80yaRWvzJhQXWsG2MSKSClltpVPb7T7Y+dBL TR4Ut6ZYbT6+A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jaroslav Kysela , Dan Carpenter , Takashi Iwai , Sasha Levin Subject: [PATCH 5.15 69/76] ALSA: usb-audio: Always initialize fixed_rate in snd_usb_find_implicit_fb_sync_format() Date: Wed, 13 Mar 2024 12:42:16 -0400 Message-ID: <20240313164223.615640-70-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313164223.615640-1-sashal@kernel.org> References: <20240313164223.615640-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.152-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.15.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.15.152-rc1 X-KernelTest-Deadline: 2024-03-15T16:42+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jaroslav Kysela [ Upstream commit 291e9da91403e0e628d7692b5ed505100e7b7706 ] Handle the fallback code path, too. Fixes: fd28941cff1c ("ALSA: usb-audio: Add new quirk FIXED_RATE for JBL Quantum810 Wireless") BugLink: https://lore.kernel.org/alsa-devel/Y7frf3N%2FxzvESEsN@kili/ Reported-by: Dan Carpenter Cc: Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20230109141133.335543-1-perex@perex.cz Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/usb/implicit.c | 3 ++- sound/usb/pcm.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/usb/implicit.c b/sound/usb/implicit.c index 41ac7185b42b6..4727043fd7458 100644 --- a/sound/usb/implicit.c +++ b/sound/usb/implicit.c @@ -471,7 +471,7 @@ snd_usb_find_implicit_fb_sync_format(struct snd_usb_audio *chip, subs = find_matching_substream(chip, stream, target->sync_ep, target->fmt_type); if (!subs) - return sync_fmt; + goto end; high_score = 0; list_for_each_entry(fp, &subs->fmt_list, list) { @@ -485,6 +485,7 @@ snd_usb_find_implicit_fb_sync_format(struct snd_usb_audio *chip, } } + end: if (fixed_rate) *fixed_rate = snd_usb_pcm_has_fixed_rate(subs); return sync_fmt; diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 962a6e1bc70c8..580e2649641e4 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -163,6 +163,8 @@ bool snd_usb_pcm_has_fixed_rate(struct snd_usb_substream *subs) struct snd_usb_audio *chip = subs->stream->chip; int rate = -1; + if (!subs) + return false; if (!(chip->quirk_flags & QUIRK_FLAG_FIXED_RATE)) return false; list_for_each_entry(fp, &subs->fmt_list, list) { -- 2.43.0