summaryrefslogtreecommitdiff
path: root/sound/core/compress_offload.c
diff options
context:
space:
mode:
authorXiaojun Sang <xsang@codeaurora.org>2019-10-21 12:54:32 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-05 11:19:35 +0300
commite8eb6233be9a838c637daf34ddd41d7c5154a93e (patch)
treea4038dbabbf8b09ecf329f4747db6b4240fdb59e /sound/core/compress_offload.c
parent7971b7fd5623b6d8134f463ffc76aaf4f888c36e (diff)
downloadlinux-e8eb6233be9a838c637daf34ddd41d7c5154a93e.tar.xz
ASoC: compress: fix unsigned integer overflow check
[ Upstream commit d3645b055399538415586ebaacaedebc1e5899b0 ] Parameter fragments and fragment_size are type of u32. U32_MAX is the correct check. Signed-off-by: Xiaojun Sang <xsang@codeaurora.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Acked-by: Vinod Koul <vkoul@kernel.org> Link: https://lore.kernel.org/r/20191021095432.5639-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/core/compress_offload.c')
-rw-r--r--sound/core/compress_offload.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index 516ec3587325..509038d6bccd 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -529,7 +529,7 @@ static int snd_compress_check_input(struct snd_compr_params *params)
{
/* first let's check the buffer parameter's */
if (params->buffer.fragment_size == 0 ||
- params->buffer.fragments > INT_MAX / params->buffer.fragment_size ||
+ params->buffer.fragments > U32_MAX / params->buffer.fragment_size ||
params->buffer.fragments == 0)
return -EINVAL;