ASoC: intel: sst: Handle return value of platform_get_irq
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 29 Nov 2017 16:17:13 +0000 (21:47 +0530)
committerMark Brown <broonie@kernel.org>
Fri, 1 Dec 2017 13:06:57 +0000 (13:06 +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/atom/sst/sst_acpi.c

index 32d6e02e21049719feb32691ee0ded359b5a4572..6cd481bec27524c6e8bd395071ba066fd97871e2 100644 (file)
@@ -236,6 +236,9 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
        /* Find the IRQ */
        ctx->irq_num = platform_get_irq(pdev,
                                ctx->pdata->res_info->acpi_ipc_irq_index);
+       if (ctx->irq_num <= 0)
+               return ctx->irq_num < 0 ? ctx->irq_num : -EIO;
+
        return 0;
 }