diff mbox

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

Message ID 64135c4647a3a94261a669d7f49611a356f334bf.1511062844.git.arvind.yadav.cs@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Arvind Yadav Nov. 19, 2017, 4:15 a.m. UTC
platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
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 mbox

Patch

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 */