From nobody Mon Jun 8 04:25:04 2026 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 382042D47E9 for ; Sun, 7 Jun 2026 02:56:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780800990; cv=none; b=PeDqhBftuKbs7KFopbJLSg4ENx9Cj8qHHAGV3Pc5rzcMn7sUDQTuPUD5MT4BGBBlNYcCZMXkFAewctinlv9MA6mi760f8LDhRQIcC8Ewn1buJS9/YT3KiLiPtRaKLu3Uf25xvb2A71PRw1coqch4xc8LUZjTZ1dmdHlKdxo3TK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780800990; c=relaxed/simple; bh=h4D1p5n2M2aVtJ5FucynXrOgzWmf8Z0296oAicUsHO8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XeSIuzgQqlBimpCVgvV4aZCYbo7Nf4OybJFBOuUlEqPW2/XEe5ust366sqYP2PFwDSt1+hei/0uPy6Z2hKng3Z6YjCWp3SCVed/wEnCchni4lPKnPf2qqmLaAsLFtQrSO4K53aRyTfCpPPc1fCyN22cPfUoBMry6oHgq6PVqPjA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IQx4De6b; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IQx4De6b" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-842848fd613so2612433b3a.3 for ; Sat, 06 Jun 2026 19:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780800988; x=1781405788; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sNgrTQjhmrCkcd6OOoTKxY6nLRLb3JmG0yUB0AfnPpw=; b=IQx4De6bJxgHnvmkdJ78qeJ5mIUglPPDSXyM4Kdf/EoK5bBAuzu2SCfCzJIOewgO5G urWwfuoGyzOk+MZSSdmQuyOWMQ7RH0SV1rn1pQhFZk3GzK7BRdm698DtzfFI5l4Qvq/e CqR6fFoyWg1u8MY3TqjQtyHiL2PUuRU3hU/O0zW2it/j1n6xibLqdsywVwfabbn1Vba8 E45+gHCAfKNyyMUCYNUetjXfLCf0JhCyFjWI/KZhpIJBvsuj6N/wHnOCBvq0ysVy3G+g G120J6r2Aey6aBdDOQ8i7smxWyDb8iOfq9cV/k377KuL6m2l/OBAd4Rqc+Ke/T+zVE7C OzKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780800988; x=1781405788; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=sNgrTQjhmrCkcd6OOoTKxY6nLRLb3JmG0yUB0AfnPpw=; b=RCEtsFG8k6PEJLeZs+gtHa+9LNFiWajd+s3VTCdc34NH3p0VT6aOyueJTcR10uJwgD UDiDCY8AUjlyeCmrcAdWBLPCnn3fk1fbZjpKRzf98ZiYXXiIryxSoMFWvpCqNSsvQzUO Y4c0vIQ2lkpobmcWqTlpL1T0+bh9rmcI1eNq03MEhB9zfUDckDpja8fFPt5I7NVbLfKG pQjB2bMbdl39KQ303XRPu4GjdS7qxpZlkhg3IxqAg1xP/0azBj6fnSXnCLlTYJUuS74h Jp94AaqKtMimcB+ruHCtN7fSONwgmsLhZVBTmt82WyWUYeDUvbNLxTvuXfDimZ6rXXdJ G1Sg== X-Forwarded-Encrypted: i=1; AFNElJ/a84baNL86VLYJa3abJZ11oMOhgrvdHR3NkNIJCqd4+lGWR+j9K2ICzIF+fNe7CF7/b+Q0Ro7ZiMRmO7U=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7fotkYbfEBdn4oy0hNmTMrCi47tZds9gaAgrLMczv5pIXW+D9 mddBr0MCIKax5UfPN8mtOoce06Jiaa2PI4P2ZpqyM+HnDuoi69Rve9Pg X-Gm-Gg: Acq92OHD0bzmfv1eC9w4TqudVExswTqUm8NayvCSzRGFAzfkvmI0rsugDdXNzKTPy/M 7a6MMvFbzkuZf5uC5OdrZSLdtlIUY+2GlYDLjyVpL6HEqmYJ0//MJ5/MGqlPmaJyjEoMZTpEG1c pP8B5OHYpzBeL/WELrwSccJzsF3IIhtMKGLmxYCCnHnvTZUt8k9rTgltrIl90O9pQiUZQGLjCGf kRb6IXkaK05yo18mGZ2MVvi0ryxnzVT3fcbPVxD5pAP1y/XR/ClFlK1Pdg4YjK5/RrNAmrg6Hoh V/TdAmlF+WcirKYDinCVjeWia3eJ9VY/Cp8Ez1iZRomVuHjn4eAKEmjN7MmG1JlCZMIf8NEP3hp klj68WPQljmwuG5jxopkkzQmvuTeKYI5D65rbIrbRVE2STPwTQhdkvIcmAbzK2V/a7RRZFH0LSV h+ujVqXX7FpeOSmTGF2pAYpSBd8UZzN0YNwmfGSHjiGfkLub2kdkw+EA== X-Received: by 2002:aa7:88c6:0:b0:841:dc85:1638 with SMTP id d2e1a72fcca58-842b1095767mr10394171b3a.42.1780800988402; Sat, 06 Jun 2026 19:56:28 -0700 (PDT) Received: from haichao.tail057a43.ts.net ([2001:da8:e000:1206:967f:7ce4:ec98:f08b]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84282918b8csm13034210b3a.57.2026.06.06.19.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jun 2026 19:56:28 -0700 (PDT) From: Ruoyu Wang To: tiwai@suse.de Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Ruoyu Wang Subject: [PATCH] ALSA: ice1712: aureon: check CS8415 control allocation Date: Sun, 7 Jun 2026 10:56:10 +0800 Message-ID: <20260607025613.3604194-6-ruoyuw560@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260607025613.3604194-1-ruoyuw560@gmail.com> References: <20260607025613.3604194-1-ruoyuw560@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" aureon_add_controls() creates CS8415 controls and, for later entries, adjusts kctl->id.device before adding the control. snd_ctl_new1() can return NULL, so the device-id update can dereference NULL before the control core sees the pointer. Return -ENOMEM when the control allocation fails. Signed-off-by: Ruoyu Wang --- sound/pci/ice1712/aureon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c index 1191a2686dfd2..d6abff2978f3d 100644 --- a/sound/pci/ice1712/aureon.c +++ b/sound/pci/ice1712/aureon.c @@ -1891,6 +1891,8 @@ static int aureon_add_controls(struct snd_ice1712 *ic= e) for (i =3D 0; i < ARRAY_SIZE(cs8415_controls); i++) { struct snd_kcontrol *kctl; kctl =3D snd_ctl_new1(&cs8415_controls[i], ice); + if (!kctl) + return -ENOMEM; if (i > 1) kctl->id.device =3D ice->pcm->device; err =3D snd_ctl_add(ice->card, kctl); --=20 2.34.1