From mboxrd@z Thu Jan 1 00:00:00 1970 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 1AEF52FE577; Mon, 13 Oct 2025 15:01:59 +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=1760367719; cv=none; b=P9TIFl454CQjgUH0RDIqTVxwNSLJbipmgks15Dax+qaq/AhG6IQMQMDyhsWm/5BAqNXuhMZZcWT6YkNVPzmcHoeyOeMaKRDYP1/uJ56tpEqqwfeCdFNzqClsj50AjxJWFHluWBJwcVL8FUX3N8R+GBHY4cI1jGXrMlGYrO3y1Og= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760367719; c=relaxed/simple; bh=D3+Y4KbodPS5t4vbiA7cyBxTizcrw7s0OmS20rWh0nE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gcjFoV6WubnYeDuuWsZKubcMvkACErms2KjOXDZNC2HroKyP2cGV5nvhkC9rCWqcOMPwWhxUcIwhOrt3FZdyvyjw1JtNleAPjJowRi8QW9Hz1gatea/C++xBHalXTl3JuRda1lWzmHU5hEoDBHCbjD0E6QukY8OsbIZVywNBQg0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FVPpjJT7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="FVPpjJT7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A9E1C4CEFE; Mon, 13 Oct 2025 15:01:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760367719; bh=D3+Y4KbodPS5t4vbiA7cyBxTizcrw7s0OmS20rWh0nE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FVPpjJT7rk9MOWqrbgEOwx7qdTlz3Zwiqldp6t9RKPJF+d14qb9BOWbRcCpJMkJLO yp49po/Lcfd0Nqlbp/pvaRTP+NgzMHFqfzzXdMhM6NkgfWkfKKQj8uDPU5hKFxBZXp XQWQbyKU8tMEJKujtyARUretxxBt7Zw9Nv0FV2u0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Takashi Iwai , Mark Brown , Sasha Levin Subject: [PATCH 6.6 102/196] ASoC: Intel: bytcr_rt5640: Fix invalid quirk input mapping Date: Mon, 13 Oct 2025 16:44:53 +0200 Message-ID: <20251013144319.005066485@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251013144315.184275491@linuxfoundation.org> References: <20251013144315.184275491@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Takashi Iwai [ Upstream commit fba404e4b4af4f4f747bb0e41e9fff7d03c7bcc0 ] When an invalid value is passed via quirk option, currently bytcr_rt5640 driver only shows an error message but leaves as is. This may lead to unepxected results like OOB access. This patch corrects the input mapping to the certain default value if an invalid value is passed. Fixes: 063422ca2a9d ("ASoC: Intel: bytcr_rt5640: Set card long_name based on quirks") Signed-off-by: Takashi Iwai Message-ID: <20250902171826.27329-3-tiwai@suse.de> Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/intel/boards/bytcr_rt5640.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index 6a85e8fdcae64..beca466dd468e 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c @@ -68,7 +68,8 @@ enum { BYT_RT5640_OVCD_SF_1P5 = (RT5640_OVCD_SF_1P5 << 13), }; -#define BYT_RT5640_MAP(quirk) ((quirk) & GENMASK(3, 0)) +#define BYT_RT5640_MAP_MASK GENMASK(3, 0) +#define BYT_RT5640_MAP(quirk) ((quirk) & BYT_RT5640_MAP_MASK) #define BYT_RT5640_JDSRC(quirk) (((quirk) & GENMASK(7, 4)) >> 4) #define BYT_RT5640_OVCD_TH(quirk) (((quirk) & GENMASK(12, 8)) >> 8) #define BYT_RT5640_OVCD_SF(quirk) (((quirk) & GENMASK(14, 13)) >> 13) @@ -140,7 +141,9 @@ static void log_quirks(struct device *dev) dev_info(dev, "quirk NO_INTERNAL_MIC_MAP enabled\n"); break; default: - dev_err(dev, "quirk map 0x%x is not supported, microphone input will not work\n", map); + dev_warn_once(dev, "quirk sets invalid input map: 0x%x, default to DMIC1_MAP\n", map); + byt_rt5640_quirk &= ~BYT_RT5640_MAP_MASK; + byt_rt5640_quirk |= BYT_RT5640_DMIC1_MAP; break; } if (byt_rt5640_quirk & BYT_RT5640_HSMIC2_ON_IN1) -- 2.51.0