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 0F42A1FCFE2; Mon, 2 Jun 2025 14:47:29 +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=1748875649; cv=none; b=IRVtN77kJLn3xF6Rw/ApKdN77hh2SjPp3zuNrZJwPqEZ8MmeVTwEksuWJVQKutkfV0dFjrtISXP2zN2E9nyy5eZX01rki/1HF94N2aDk1bXYc8Rbe0IegXeNdmQsxueKgUtH9IJ+HG02c5zZqL47AI91DyvL+cr/QZNNDWh5b2w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748875649; c=relaxed/simple; bh=RWc7VnWpyilLxWVL/SoalTiWIC7C+vQ1Qaq3a5Eim9Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PIi4h9TyYA3bay+napCUZjxXOfAG0RyR+s/a6BOGEfpzBrfCt/2SBT0wPeMFTuoAzP/9WkuhBW9VTGklSP4LzzgNIemXMYf6ntYw0DUWyvWM6n4ImT+q8RKtA906m7AXZBEMXosmD9+FMzMOiD/mPMgb9QE3Z+gn1tkKZkMZT5A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BQ1A27mN; 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="BQ1A27mN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81877C4CEEB; Mon, 2 Jun 2025 14:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748875648; bh=RWc7VnWpyilLxWVL/SoalTiWIC7C+vQ1Qaq3a5Eim9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BQ1A27mNzuafmse6TzaJQMIQYCqovHVdZFSjsdxzRLNKvzBLtsysMRonRkrpMnZk8 cOEHfO5N9TLN2n0BQ91tNep0k+FFxh/uoTDExIWb76sjIaWcqUqfGv9Bqhzf4DtXUy GqKbqN7GdhdaFzsKJwocx1uGO1I4FKM0rHQlHqNc= 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 5.10 201/270] ASoC: soc-dai: check return value at snd_soc_dai_set_tdm_slot() Date: Mon, 2 Jun 2025 15:48:06 +0200 Message-ID: <20250602134315.404617669@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134307.195171844@linuxfoundation.org> References: <20250602134307.195171844@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 5.10-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 4705c3da6280f..f9aba413e4952 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -208,10 +208,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; dai->tx_mask = tx_mask; dai->rx_mask = rx_mask; @@ -220,6 +221,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