ASoC: Intel: Skylake: Fix to check return value of dsp init
authorJeeja KP <[email protected]>
Thu, 22 Oct 2015 17:52:40 +0000 (23:22 +0530)
committerMark Brown <[email protected]>
Fri, 23 Oct 2015 16:31:34 +0000 (01:31 +0900)
If DSP initialization fails, ipc to disable notification
will cause NULL ptr exception as ipc is not initialized.
This patch returns error if dsp init fails before
sending disable notification ipc.

Signed-off-by: Jeeja KP <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
sound/soc/intel/skylake/skl-messages.c

index ca7bbeea2cd9b01d31b3ed3f263cc5e1094908d5..a1001a686aa9e705acf37cfc5bf48ad2792fbcb6 100644 (file)
@@ -97,6 +97,9 @@ int skl_init_dsp(struct skl *skl)
 
        ret = skl_sst_dsp_init(bus->dev, mmio_base, irq,
                        loader_ops, &skl->skl_sst);
+       if (ret < 0)
+               return ret;
+
        skl_dsp_enable_notification(skl->skl_sst, false);
        dev_dbg(bus->dev, "dsp registration status=%d\n", ret);