Skip to contentSkip to conversation

ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe

PATCH In review Gustavo A. R. Silva 2 participants 5 messages Dec 26, 2018 – Jan 7, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe

Currently, if platform_get_irq_byname() fails, the returned error turns into a huge value, once it is being store into a variable of type unsigned int, hence never actually reporting any error and causing unexpected behavior when using the values stored in aud_drv_data->s2mm_irq and aud_drv_data->mm2s_irq.

Fix this by changing the type of variables s2mm_irq and mm2s_irq in structure xlnx_pcm_drv_data from unsigned int to int.

Addresses-Coverity-ID: 1476096 ("Unsigned compared against 0")

Fixes 796175a94a7f ("ASoC: xlnx: add pcm formatter platform driver")
---
 sound/soc/xilinx/xlnx_formatter_pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/xilinx/xlnx_formatter_pcm.c +2 -2
index f7235f7664d7..d2194da928e7 100644
@@ -76,8 +76,8 @@ struct xlnx_pcm_drv_data {
 	void __iomem *mmio;
 	bool s2mm_presence;
 	bool mm2s_presence;
-	unsigned int s2mm_irq;
-	unsigned int mm2s_irq;
+	int s2mm_irq;
+	int mm2s_irq;
 	struct snd_pcm_substream *play_stream;
 	struct snd_pcm_substream *capture_stream;
 	struct clk *axi_clk;
Signature · 1 line
2.20.1
maintainer
#1 lore raw

Applied "ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe" to the asoc tree

The patch

ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe

has been applied to the asoc tree at

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

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

Quoted 1 line

From fbaa95f4397eef4448bf9dbc36b7d4e961b169a6 Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 26 Dec 2018 15:11:06 -0600
Subject: [PATCH] ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe

Currently, if platform_get_irq_byname() fails, the returned error turns into a huge value, once it is being store into a variable of type unsigned int, hence never actually reporting any error and causing unexpected behavior when using the values stored in aud_drv_data->s2mm_irq and aud_drv_data->mm2s_irq.

Fix this by changing the type of variables s2mm_irq and mm2s_irq in structure xlnx_pcm_drv_data from unsigned int to int.

Addresses-Coverity-ID: 1476096 ("Unsigned compared against 0")

Fixes 796175a94a7f ("ASoC: xlnx: add pcm formatter platform driver")
---
 sound/soc/xilinx/xlnx_formatter_pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/xilinx/xlnx_formatter_pcm.c +2 -2
index f7235f7664d7..d2194da928e7 100644
@@ -76,8 +76,8 @@ struct xlnx_pcm_drv_data {
 	void __iomem *mmio;
 	bool s2mm_presence;
 	bool mm2s_presence;
-	unsigned int s2mm_irq;
-	unsigned int mm2s_irq;
+	int s2mm_irq;
+	int mm2s_irq;
 	struct snd_pcm_substream *play_stream;
 	struct snd_pcm_substream *capture_stream;
 	struct clk *axi_clk;
Signature · 1 line
2.20.1
maintainer
#2 lore raw

Applied "ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe" to the asoc tree

In reply to Gustavo A. R. Silva

The patch

ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe

has been applied to the asoc tree at

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

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

Quoted 1 line

From 1d38b4e903d577f05393eb0ac6727f40d90dd6c6 Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 26 Dec 2018 15:11:06 -0600
Subject: [PATCH] ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe

Currently, if platform_get_irq_byname() fails, the returned error turns into a huge value, once it is being store into a variable of type unsigned int, hence never actually reporting any error and causing unexpected behavior when using the values stored in aud_drv_data->s2mm_irq and aud_drv_data->mm2s_irq.

Fix this by changing the type of variables s2mm_irq and mm2s_irq in structure xlnx_pcm_drv_data from unsigned int to int.

Addresses-Coverity-ID: 1476096 ("Unsigned compared against 0")

Fixes 796175a94a7f ("ASoC: xlnx: add pcm formatter platform driver")
---
 sound/soc/xilinx/xlnx_formatter_pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/xilinx/xlnx_formatter_pcm.c +2 -2
index f7235f7664d7..d2194da928e7 100644
@@ -76,8 +76,8 @@ struct xlnx_pcm_drv_data {
 	void __iomem *mmio;
 	bool s2mm_presence;
 	bool mm2s_presence;
-	unsigned int s2mm_irq;
-	unsigned int mm2s_irq;
+	int s2mm_irq;
+	int mm2s_irq;
 	struct snd_pcm_substream *play_stream;
 	struct snd_pcm_substream *capture_stream;
 	struct clk *axi_clk;
Signature · 1 line
2.20.1
maintainer
#3 lore raw

Applied "ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe" to the asoc tree

In reply to Gustavo A. R. Silva

The patch

ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe

has been applied to the asoc tree at

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

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

Quoted 1 line

From 1d38b4e903d577f05393eb0ac6727f40d90dd6c6 Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 26 Dec 2018 15:11:06 -0600
Subject: [PATCH] ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe

Currently, if platform_get_irq_byname() fails, the returned error turns into a huge value, once it is being store into a variable of type unsigned int, hence never actually reporting any error and causing unexpected behavior when using the values stored in aud_drv_data->s2mm_irq and aud_drv_data->mm2s_irq.

Fix this by changing the type of variables s2mm_irq and mm2s_irq in structure xlnx_pcm_drv_data from unsigned int to int.

Addresses-Coverity-ID: 1476096 ("Unsigned compared against 0")

Fixes 796175a94a7f ("ASoC: xlnx: add pcm formatter platform driver")
---
 sound/soc/xilinx/xlnx_formatter_pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/xilinx/xlnx_formatter_pcm.c +2 -2
index f7235f7664d7..d2194da928e7 100644
@@ -76,8 +76,8 @@ struct xlnx_pcm_drv_data {
 	void __iomem *mmio;
 	bool s2mm_presence;
 	bool mm2s_presence;
-	unsigned int s2mm_irq;
-	unsigned int mm2s_irq;
+	int s2mm_irq;
+	int mm2s_irq;
 	struct snd_pcm_substream *play_stream;
 	struct snd_pcm_substream *capture_stream;
 	struct clk *axi_clk;
Signature · 1 line
2.20.1
maintainer
#4 lore raw

Applied "ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe" to the asoc tree

In reply to Gustavo A. R. Silva

The patch

ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe

has been applied to the asoc tree at

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

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

Quoted 1 line

From 1d38b4e903d577f05393eb0ac6727f40d90dd6c6 Mon Sep 17 00:00:00 2001

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 26 Dec 2018 15:11:06 -0600
Subject: [PATCH] ASoC: xlnx: fix error handling in xlnx_formatter_pcm_probe

Currently, if platform_get_irq_byname() fails, the returned error turns into a huge value, once it is being store into a variable of type unsigned int, hence never actually reporting any error and causing unexpected behavior when using the values stored in aud_drv_data->s2mm_irq and aud_drv_data->mm2s_irq.

Fix this by changing the type of variables s2mm_irq and mm2s_irq in structure xlnx_pcm_drv_data from unsigned int to int.

Addresses-Coverity-ID: 1476096 ("Unsigned compared against 0")

Fixes 796175a94a7f ("ASoC: xlnx: add pcm formatter platform driver")
---
 sound/soc/xilinx/xlnx_formatter_pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/xilinx/xlnx_formatter_pcm.c +2 -2
index f7235f7664d7..d2194da928e7 100644
@@ -76,8 +76,8 @@ struct xlnx_pcm_drv_data {
 	void __iomem *mmio;
 	bool s2mm_presence;
 	bool mm2s_presence;
-	unsigned int s2mm_irq;
-	unsigned int mm2s_irq;
+	int s2mm_irq;
+	int mm2s_irq;
 	struct snd_pcm_substream *play_stream;
 	struct snd_pcm_substream *capture_stream;
 	struct clk *axi_clk;
Signature · 1 line
2.20.1