ASoC: intel: mfld: Handle return value of platform_get_irq
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 29 Nov 2017 16:17:14 +0000 (21:47 +0530)
committerMark Brown <broonie@kernel.org>
Fri, 1 Dec 2017 13:07:13 +0000 (13:07 +0000)
platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/mfld_machine.c

index 6f44acf..7cb44fd 100644 (file)
@@ -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 */