linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] ASoC: qcom: fix unsigned int bitwidth compared to less than zero
@ 2020-10-28 11:51 Colin King
  2020-10-29 12:40 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-10-28 11:51 UTC (permalink / raw)
  To: Patrick Lai, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, V Sujith Kumar Reddy,
	Srinivasa Rao, alsa-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 7cb37b7bd0d3 ("ASoC: qcom: Add support for lpass hdmi driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 sound/soc/qcom/lpass-hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/qcom/lpass-hdmi.c b/sound/soc/qcom/lpass-hdmi.c
index 172952d3a5d6..abfb8737a89f 100644
--- a/sound/soc/qcom/lpass-hdmi.c
+++ b/sound/soc/qcom/lpass-hdmi.c
@@ -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;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] ASoC: qcom: fix unsigned int bitwidth compared to less than zero
  2020-10-28 11:51 [PATCH][next] ASoC: qcom: fix unsigned int bitwidth compared to less than zero Colin King
@ 2020-10-29 12:40 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-10-29 12:40 UTC (permalink / raw)
  To: Patrick Lai, Colin King, Liam Girdwood, V Sujith Kumar Reddy,
	Takashi Iwai, Banajit Goswami, Jaroslav Kysela, Srinivasa Rao,
	alsa-devel
  Cc: kernel-janitors, linux-kernel

On Wed, 28 Oct 2020 11:51:12 +0000, Colin King wrote:
> 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.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: qcom: fix unsigned int bitwidth compared to less than zero
      commit: bcc96dc3cf8048c80af7c487af17e19be27ac57d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-29 12:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-28 11:51 [PATCH][next] ASoC: qcom: fix unsigned int bitwidth compared to less than zero Colin King
2020-10-29 12:40 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).