ASoC: qcom: fix unsigned int bitwidth compared to less than zero
authorColin Ian King <colin.king@canonical.com>
Wed, 28 Oct 2020 11:51:12 +0000 (11:51 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 28 Oct 2020 21:33:22 +0000 (21:33 +0000)
The check for an error return from the call to snd_pcm_format_width
is never true as the unsigned int bitwidth can never be less than
zero. Fix this by making bitwidth an int.

Fixes: f3fe4960dd38 ("ASoC: qcom: Add support for lpass hdmi driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20201028115112.109017-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/lpass-hdmi.c

index 172952d3a5d66f4b214439539a904c21448c3de3..abfb8737a89f4137f6ee8c4b3c07c8fff501f936 100644 (file)
@@ -24,7 +24,7 @@ static int lpass_hdmi_daiops_hw_params(struct snd_pcm_substream *substream,
        unsigned int rate = params_rate(params);
        unsigned int channels = params_channels(params);
        unsigned int ret;
-       unsigned int bitwidth;
+       int bitwidth;
        unsigned int word_length;
        unsigned int ch_sts_buf0;
        unsigned int ch_sts_buf1;