lkml.org 
[lkml]   [2017]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/5 v2] ASoC: intel: mfld: Handle return value of platform_get_irq
Date
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.

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..77b3162 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;

/* audio interrupt base of SRAM location where
* interrupts are stored by System FW */
--
2.7.4
\
 
 \ /
  Last update: 2017-11-18 10:58    [W:0.023 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site