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 B79432BE058; Tue, 26 Aug 2025 14:07:48 +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=1756217268; cv=none; b=FskRPCqVHBLhZGX+Ia0nz5SRPF/6/lOruuq8ecLSkZAGnpeBqavAZkUDkKx+S7HBVR5xYGgPYuG6oTJLK4UAVIF6+ESEmQNJph5d/WGy7Zbteaj/o5YqH5b/kTTWB4iyzklL+k6ZAFG0vtzgjvbGM0imexO/T0e3AfeF/3ouFIk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756217268; c=relaxed/simple; bh=l6OAzve3gS+dNnZ98LVezjtaM4JIXA8Ol1oOzP+QwlM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FQuqunsLqywq7YZE8LEMhVnKrLzJlX+EEKmQkHppGxtB5eU59Y+wucmxqr06IOrAufy4JcMUSvm5El2uwJVZJc+6RF1yf02UT/ONu41Xmgene7PDYLVTJtUSyGfgPLNAEzcIdwPVfY/7U1ziZ+aLipFBgacveM+7M6l14ogyYnY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nScX3gEt; 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="nScX3gEt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 453AFC4CEF1; Tue, 26 Aug 2025 14:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756217268; bh=l6OAzve3gS+dNnZ98LVezjtaM4JIXA8Ol1oOzP+QwlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nScX3gEtIVGMAMBMep8RPyjmis07oR5vzgBTxT85u98MSAGkL3Ui+tuih9p+Y3oQM jH5SudJUb02bEIsKq4VbdMYKbn7S3C3uQNdFPeY0PKlkscUdr0KwUI2NmsfWcuHVSX ZzRnj91J3bxmiyDRod/YqpkmZApz3ClMNX1GIIYQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Arnd Bergmann , Mark Brown , Sasha Levin Subject: [PATCH 5.10 080/523] ASoC: ops: dynamically allocate struct snd_ctl_elem_value Date: Tue, 26 Aug 2025 13:04:50 +0200 Message-ID: <20250826110926.538903867@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110924.562212281@linuxfoundation.org> References: <20250826110924.562212281@linuxfoundation.org> User-Agent: quilt/0.68 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 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann [ Upstream commit 7e10d7242ea8a5947878880b912ffa5806520705 ] This structure is really too larget to be allocated on the stack: sound/soc/soc-ops.c:435:5: error: stack frame size (1296) exceeds limit (1280) in 'snd_soc_limit_volume' [-Werror,-Wframe-larger-than] Change the function to dynamically allocate it instead. There is probably a better way to do it since only two integer fields inside of that structure are actually used, but this is the simplest rework for the moment. Fixes: 783db6851c18 ("ASoC: ops: Enforce platform maximum on initial value") Signed-off-by: Arnd Bergmann Link: https://patch.msgid.link/20250610093057.2643233-1-arnd@kernel.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-ops.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index 55f7c7999330..91afd73cdd13 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -618,28 +618,32 @@ EXPORT_SYMBOL_GPL(snd_soc_get_volsw_range); static int snd_soc_clip_to_platform_max(struct snd_kcontrol *kctl) { struct soc_mixer_control *mc = (struct soc_mixer_control *)kctl->private_value; - struct snd_ctl_elem_value uctl; + struct snd_ctl_elem_value *uctl; int ret; if (!mc->platform_max) return 0; - ret = kctl->get(kctl, &uctl); + uctl = kzalloc(sizeof(*uctl), GFP_KERNEL); + if (!uctl) + return -ENOMEM; + + ret = kctl->get(kctl, uctl); if (ret < 0) - return ret; + goto out; - if (uctl.value.integer.value[0] > mc->platform_max) - uctl.value.integer.value[0] = mc->platform_max; + if (uctl->value.integer.value[0] > mc->platform_max) + uctl->value.integer.value[0] = mc->platform_max; if (snd_soc_volsw_is_stereo(mc) && - uctl.value.integer.value[1] > mc->platform_max) - uctl.value.integer.value[1] = mc->platform_max; + uctl->value.integer.value[1] > mc->platform_max) + uctl->value.integer.value[1] = mc->platform_max; - ret = kctl->put(kctl, &uctl); - if (ret < 0) - return ret; + ret = kctl->put(kctl, uctl); - return 0; +out: + kfree(uctl); + return ret; } /** -- 2.39.5