platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <[email protected]>
---
changes in v2 :
Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v3 :
Return -ENODEV insted of irq.
changes in v4 :
Add separate error for irq == 0 and irq < 0.
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..7cb44fd 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 irq < 0 ? irq : -ENODEV;
/* audio interrupt base of SRAM location where
* interrupts are stored by System FW */
--
2.7.4
From 1585436422860688951@xxx Wed Nov 29 21:13:16 +0000 2017
X-GM-THRID: 1585248952618889709
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread