From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 706454195BB for ; Mon, 13 Jul 2026 13:12:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783948337; cv=none; b=ZW5+zQRVmWksaTOMArz2XusiZQG8kxJQsCJskWPNifSnX7MXEBZRksqpOQLBonx+UOyK3npZQ7pA+HWXZm8fKCmYBoRCiYr0WobGsbwOthgxp9fy0XddQkYrIEfSVdk3FrpKqO7W/UrIma6DcceCk0ZWnFc4ynQgdSGvuZ0qVIg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783948337; c=relaxed/simple; bh=BgWURS6kpK6O2Or8SVdi8tkN1LkgZRO+BGbHuQeR2fQ=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=V7uF5ZcU2JwA4lBbyXhL+R7fkDcKHxbG/3xADLHROo0JR/xU4ObISSAYi1mdn3Ik4GTniO7NlOZakbM2ucC4Ql5P7oeJUjMjEjGrkOiukPZWq1Ot/lcaqzCYiCillKtiYO40CrptYKdaOWTcR5OM7RUPg92SnJNZIEutptW0Mt0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1ovo3GZ9; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1ovo3GZ9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D658C1F000E9; Mon, 13 Jul 2026 13:12:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783948336; bh=G5L038c0zQyEjJaa6MNbrI3w0xVe7wLxUpwOyJTeZro=; h=Subject:To:Cc:From:Date; b=1ovo3GZ9Xe7ha5kZDTiGCBeBWwocZ7BGEMTSXOqAI7Q9Zdf97fBQm5FR4Aajh8GcT 8jFaOmJKNFR2fMpglJ6Xb5ZmezHIHtNI/+Qa3ZNE38yG/OOncYbwkD/S8bBggb1wnt Bn3Qxieooqao8zIgyNmfzLQbjO4meGXsrxQuvJRg= Subject: FAILED: patch "[PATCH] ALSA: aoa: check snd_ctl_new1() return value" failed to apply to 5.10-stable tree To: zhaodongdong@kylinos.cn,tiwai@suse.de Cc: From: Date: Mon, 13 Jul 2026 14:59:00 +0200 Message-ID: <2026071300-landmass-domain-9bfb@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 8df560fefe6fed6a20b7e06720eeaeccec349ac0 # git commit -s git send-email --to '' --in-reply-to '2026071300-landmass-domain-9bfb@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 8df560fefe6fed6a20b7e06720eeaeccec349ac0 Mon Sep 17 00:00:00 2001 From: Zhao Dongdong Date: Wed, 27 May 2026 20:09:14 +0800 Subject: [PATCH] ALSA: aoa: check snd_ctl_new1() return value snd_ctl_new1() can return NULL when memory allocation fails. In layout.c, the function does not check the return value before dereferencing ctl->id.name or passing to aoa_snd_ctl_add(), which can lead to a NULL pointer dereference. Add NULL checks after snd_ctl_new1() calls and return early if any fails. Assisted-by: Opencode:DeepSeek-V4-Flash Cc: stable@vger.kernel.org Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa") Signed-off-by: Zhao Dongdong Link: https://patch.msgid.link/tencent_35F3A25FEEBF190A2E15ED787754C57E3708@qq.com Signed-off-by: Takashi Iwai diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c index c3ebb6de4789..7bb541577a26 100644 --- a/sound/aoa/fabrics/layout.c +++ b/sound/aoa/fabrics/layout.c @@ -948,6 +948,8 @@ static void layout_attached_codec(struct aoa_codec *codec) if (lineout == 1) ldev->gpio.methods->set_lineout(codec->gpio, 1); ctl = snd_ctl_new1(&lineout_ctl, codec->gpio); + if (!ctl) + return; if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE) strscpy(ctl->id.name, "Headphone Switch"); ldev->lineout_ctrl = ctl; @@ -961,12 +963,16 @@ static void layout_attached_codec(struct aoa_codec *codec) if (ldev->have_lineout_detect) { ctl = snd_ctl_new1(&lineout_detect_choice, ldev); + if (!ctl) + return; if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE) strscpy(ctl->id.name, "Headphone Detect Autoswitch"); aoa_snd_ctl_add(ctl); ctl = snd_ctl_new1(&lineout_detected, ldev); + if (!ctl) + return; if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE) strscpy(ctl->id.name, "Headphone Detected");