ASoC: Intel: Check ops before we derefference pointers.
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>
Wed, 30 Jul 2014 12:18:32 +0000 (20:18 +0800)
committerMark Brown <broonie@linaro.org>
Wed, 30 Jul 2014 12:24:21 +0000 (13:24 +0100)
Check ops pointer members before we can derefference them.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/intel/sst-dsp.c

index 0b715b20a2d7d46b9f06189de1ee57d9aacc28ab..cd23060a0d862f541cedb55e37d452d6bcf8c3c0 100644 (file)
@@ -224,19 +224,23 @@ EXPORT_SYMBOL_GPL(sst_dsp_shim_update_bits64);
 
 void sst_dsp_dump(struct sst_dsp *sst)
 {
-       sst->ops->dump(sst);
+       if (sst->ops->dump)
+               sst->ops->dump(sst);
 }
 EXPORT_SYMBOL_GPL(sst_dsp_dump);
 
 void sst_dsp_reset(struct sst_dsp *sst)
 {
-       sst->ops->reset(sst);
+       if (sst->ops->reset)
+               sst->ops->reset(sst);
 }
 EXPORT_SYMBOL_GPL(sst_dsp_reset);
 
 int sst_dsp_boot(struct sst_dsp *sst)
 {
-       sst->ops->boot(sst);
+       if (sst->ops->boot)
+               sst->ops->boot(sst);
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(sst_dsp_boot);