diff options
author | Xiaojun Sang <xsang@codeaurora.org> | 2019-10-21 11:54:32 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-10-21 14:50:19 +0200 |
commit | d3645b055399538415586ebaacaedebc1e5899b0 (patch) | |
tree | 8d21588f6f1029f0025890ab5dd185d2d8aa8ec6 /sound/core | |
parent | ASoC: msm8916-wcd-analog: Fix RX1 selection in RDAC2 MUX (diff) | |
download | linux-d3645b055399538415586ebaacaedebc1e5899b0.tar.xz linux-d3645b055399538415586ebaacaedebc1e5899b0.zip |
ASoC: compress: fix unsigned integer overflow check
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>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/compress_offload.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 99b882158705..942af8c29b79 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -528,7 +528,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; |