Thread (8 messages) 8 messages, 3 authors, 2017-11-29
STALE3131d

[PATCH 5/5 v3] ASoC: intel: mfld: Handle return value of platform_get_irq

From: Arvind Yadav <hidden>
Date: 2017-11-19 04:15:44
Also in: alsa-devel, linux-mediatek, lkml
Subsystem: intel asoc drivers, sound, sound - soc layer / dynamic audio power management (asoc), the rest · Maintainers: Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao, Kai Vehmanen, Jaroslav Kysela, Takashi Iwai, Mark Brown, Linus Torvalds

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <redacted>
---
changes in v2 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v3 :
              Return EIO insted of ctx->irq_num.

 sound/soc/intel/boards/mfld_machine.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/sound/soc/intel/boards/mfld_machine.c b/sound/soc/intel/boards/mfld_machine.c
index 6f44acf..c819210 100644
--- a/sound/soc/intel/boards/mfld_machine.c
+++ b/sound/soc/intel/boards/mfld_machine.c
@@ -372,6 +372,8 @@ static int snd_mfld_mc_probe(struct platform_device *pdev)
 
 	/* retrive the irq number */
 	irq = platform_get_irq(pdev, 0);
+	if (irq <= 0)
+		return -ENODEV;
 
 	/* audio interrupt base of SRAM location where
 	 * interrupts are stored by System FW */
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help