From nobody Fri Sep 25 10:05:40 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (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 041093BFAF5; Mon, 14 Sep 2026 10:47:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789382876; cv=none; b=lf+71CXRKDZMha0KdzJfhPtvswGDM35+eubWlInfBLbAMn+h3g+eH4jxs52OlhlTUaiMBuu775SnyMDPFu3ivu2FcnMLhWRz/UBxhluvc6KWZFgkvf3sOz/wphLQSmlKqIifAkslycd15neNSCv9A/JIR+fTL2B+wPe5lW4N0gU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789382876; c=relaxed/simple; bh=YphhuIEr0fTPZFFG0wioG82gi0Gb9B0j7EjpZe3MlgM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=L5TCq5OZJyyRQT4qxgs+ClJD9QxnJWYOMmETO5lDtZ4f4XlpH2cs/wiTuhyvcghwqcbr7rRoI8+18TH7da5pdrkgHfiVNPerpWpnb7fT4MOCXBv43IZsTRlBMChoBg7ba96An7/0wrnU1i9V619JxbilgwzYQbIxviNhahONp6I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: b46b8df8b02911f19a56ed5b684f684d-20260914 X-CTIC-Tags: HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NAME, HR_CC_NO_NAME, HR_CTE_8B HR_CTT_MISS, HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_NAME HR_SJ_DIGIT_LEN, HR_SJ_LANG, HR_SJ_LEN, HR_SJ_LETTER, HR_SJ_NOR_SYM HR_SJ_PHRASE, HR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_COUNT, HR_TO_DOMAIN_COUNT HR_TO_NO_NAME, IP_TRUSTED, SRC_TRUSTED, DN_TRUSTED, SA_TRUSTED SA_EXISTED, SN_TRUSTED, SN_EXISTED, SPF_NOPASS, DKIM_NOPASS DMARC_NOPASS, CIE_BAD, CIE_GOOD, CIE_GOOD_SPF, GTI_FG_BS GTI_RG_INFO, GTI_C_BU, AMN_GOOD, ABX_MISS_RDNS X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.19,REQID:07cdf5b0-a8b5-4a06-b3f0-b04b8cae2a9b,IP:15, URL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-10 X-CID-INFO: VERSION:1.3.19,REQID:07cdf5b0-a8b5-4a06-b3f0-b04b8cae2a9b,IP:15,UR L:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-10 X-CID-META: VersionHash:7db8b62,CLOUDID:9bd63d9ec08bc900a0d253bc3b4fd0df,BulkI D:260914184743QP54VZ76,BulkQuantity:0,SF:10|38|66|78|102|127|850|865|898,T C:nil,Content:0|15|50|99,EDM:-3,IP:-2,URL:0,File:nil,RT:nil,Bulk:nil,QS:ni l,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC: 0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: b46b8df8b02911f19a56ed5b684f684d-20260914 X-User: yijiangshan@kylinos.cn Received: from localhost.localdomain [(116.128.244.171)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1120140500; Mon, 14 Sep 2026 18:47:39 +0800 From: Jiangshan Yi To: oder_chiou@realtek.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com Cc: shumingf@realtek.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, 13667453960@163.com, Jiangshan Yi , stable@vger.kernel.org Subject: [PATCH] ASoC: codecs: rt712-sdca-dmic: fix uninitialized stream_config->type Date: Mon, 14 Sep 2026 18:47:12 +0800 Message-Id: <20260914104712.379574-1-yijiangshan@kylinos.cn> X-Mailer: git-send-email 2.25.1 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" stream_config is not initialized before being passed to sdw_stream_add_slave(). The type field may contain garbage and is later copied to stream->type by sdw_config_stream(). Zero-initialize stream_config so type defaults to SDW_STREAM_PCM. While at it, use snd_sdw_params_to_config() helper instead of open-coding the same logic. Fixes: 63a511284c9e ("ASoC: rt712-sdca: Add RT712 SDCA driver for Mic topol= ogy") Cc: stable@vger.kernel.org Signed-off-by: Jiangshan Yi Reviewed-by: Pierre-Louis Bossart --- sound/soc/codecs/rt712-sdca-dmic.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sound/soc/codecs/rt712-sdca-dmic.c b/sound/soc/codecs/rt712-sd= ca-dmic.c index 8860d81134e7..a9f3aa4e143a 100644 --- a/sound/soc/codecs/rt712-sdca-dmic.c +++ b/sound/soc/codecs/rt712-sdca-dmic.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include "rt712-sdca.h" #include "rt712-sdca-dmic.h" @@ -632,10 +633,10 @@ static int rt712_sdca_dmic_hw_params(struct snd_pcm_s= ubstream *substream, { struct snd_soc_component *component =3D dai->component; struct rt712_sdca_dmic_priv *rt712 =3D snd_soc_component_get_drvdata(comp= onent); - struct sdw_stream_config stream_config; + struct sdw_stream_config stream_config =3D {0}; struct sdw_port_config port_config; struct sdw_stream_runtime *sdw_stream; - int retval, num_channels; + int retval; unsigned int sampling_rate; dev_dbg(dai->dev, "%s %s", __func__, dai->name); @@ -647,13 +648,8 @@ static int rt712_sdca_dmic_hw_params(struct snd_pcm_su= bstream *substream, if (!rt712->slave) return -EINVAL; - stream_config.frame_rate =3D params_rate(params); - stream_config.ch_count =3D params_channels(params); - stream_config.bps =3D snd_pcm_format_width(params_format(params)); - stream_config.direction =3D SDW_DATA_DIR_TX; - - num_channels =3D params_channels(params); - port_config.ch_mask =3D GENMASK(num_channels - 1, 0); + /* SoundWire specific configuration */ + snd_sdw_params_to_config(substream, params, &stream_config, &port_config); port_config.num =3D 2; retval =3D sdw_stream_add_slave(rt712->slave, &stream_config, -- 2.25.1