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 11D6B1D432D; Tue, 27 May 2025 17:03:13 +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=1748365393; cv=none; b=eHXai48hwGBw0b88GmP29jYiIgXwaLXWFM1X512C1DW7Lk/7ZW+yGjT8Z65YhYwIdXq8UrQWAneYujHPcVlSV2J19KPmHbjkgyLMemjder9yJiJHxb1LI/ZNYAwH9fxp3Md3lfvua5nLf1IA8M6sCZ7LGRhgnZgjWxrIlpJWUBw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748365393; c=relaxed/simple; bh=bLtPhl5A/IFeCud3gNmu+BnuNiUOn2C4FGRucUe6TVI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p3P8FaKRTLRtGvlEUcpdtnERPgMpiNMl0nBsTrFKPL5m2B+/5cDKzg1xHeVepJN7fZ0Wfq78fp6f+dV9o04COjGCgd+F7n4AnO/ZWF2d+QZ8ytS385IuxEHZx2TJVIe42XQ7dTA/27e0uszcm6m9vqwlWLxoZi8s0S8DV9gHMRo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=At5c3ZQI; 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="At5c3ZQI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B2E0C4CEE9; Tue, 27 May 2025 17:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748365392; bh=bLtPhl5A/IFeCud3gNmu+BnuNiUOn2C4FGRucUe6TVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=At5c3ZQIgvNB5h/VHWDMNcEBMEtLp4HahQ28munEMb9LFvhObQqehPKlrBztLjYo0 EGdVoZDoRaPst5/e1mp1e86NnznHTEpVPA6Fgm8d46rEY5QVvV8gJOELJX81kaVUwd Qtkqar6+UMoLO4YbNaM12t2bJ4h/Q+4Em6S5SZps= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kuninori Morimoto , Mark Brown , Sasha Levin Subject: [PATCH 6.12 362/626] ASoC: soc-dai: check return value at snd_soc_dai_set_tdm_slot() Date: Tue, 27 May 2025 18:24:15 +0200 Message-ID: <20250527162459.720205933@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162445.028718347@linuxfoundation.org> References: <20250527162445.028718347@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kuninori Morimoto [ Upstream commit 7f1186a8d738661b941b298fd6d1d5725ed71428 ] snd_soc_dai_set_tdm_slot() calls .xlate_tdm_slot_mask() or snd_soc_xlate_tdm_slot_mask(), but didn't check its return value. Let's check it. This patch might break existing driver. In such case, let's makes each func to void instead of int. Signed-off-by: Kuninori Morimoto Link: https://patch.msgid.link/87o6z7yk61.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-dai.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 4e08892d24c62..de09d21add453 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -275,10 +275,11 @@ int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, if (dai->driver->ops && dai->driver->ops->xlate_tdm_slot_mask) - dai->driver->ops->xlate_tdm_slot_mask(slots, - &tx_mask, &rx_mask); + ret = dai->driver->ops->xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask); else - snd_soc_xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask); + ret = snd_soc_xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask); + if (ret) + goto err; for_each_pcm_streams(stream) snd_soc_dai_tdm_mask_set(dai, stream, *tdm_mask[stream]); @@ -287,6 +288,7 @@ int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, dai->driver->ops->set_tdm_slot) ret = dai->driver->ops->set_tdm_slot(dai, tx_mask, rx_mask, slots, slot_width); +err: return soc_dai_ret(dai, ret); } EXPORT_SYMBOL_GPL(snd_soc_dai_set_tdm_slot); -- 2.39.5