aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel
diff options
context:
space:
mode:
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>2014-07-30 08:18:32 -0400
committerMark Brown <broonie@linaro.org>2014-07-30 08:24:21 -0400
commit30bba67c43c0dd36696d1209c19afc3f25f2f3f3 (patch)
treeb63eab449330ebadb9d50e098b166a515072821a /sound/soc/intel
parent543ec637e00a9000772c315a8c98fa6ede563c5b (diff)
ASoC: Intel: Check ops before we derefference pointers.
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>
Diffstat (limited to 'sound/soc/intel')
-rw-r--r--sound/soc/intel/sst-dsp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/intel/sst-dsp.c b/sound/soc/intel/sst-dsp.c
index 0b715b20a2d7..cd23060a0d86 100644
--- a/sound/soc/intel/sst-dsp.c
+++ b/sound/soc/intel/sst-dsp.c
@@ -224,19 +224,23 @@ EXPORT_SYMBOL_GPL(sst_dsp_shim_update_bits64);
224 224
225void sst_dsp_dump(struct sst_dsp *sst) 225void sst_dsp_dump(struct sst_dsp *sst)
226{ 226{
227 sst->ops->dump(sst); 227 if (sst->ops->dump)
228 sst->ops->dump(sst);
228} 229}
229EXPORT_SYMBOL_GPL(sst_dsp_dump); 230EXPORT_SYMBOL_GPL(sst_dsp_dump);
230 231
231void sst_dsp_reset(struct sst_dsp *sst) 232void sst_dsp_reset(struct sst_dsp *sst)
232{ 233{
233 sst->ops->reset(sst); 234 if (sst->ops->reset)
235 sst->ops->reset(sst);
234} 236}
235EXPORT_SYMBOL_GPL(sst_dsp_reset); 237EXPORT_SYMBOL_GPL(sst_dsp_reset);
236 238
237int sst_dsp_boot(struct sst_dsp *sst) 239int sst_dsp_boot(struct sst_dsp *sst)
238{ 240{
239 sst->ops->boot(sst); 241 if (sst->ops->boot)
242 sst->ops->boot(sst);
243
240 return 0; 244 return 0;
241} 245}
242EXPORT_SYMBOL_GPL(sst_dsp_boot); 246EXPORT_SYMBOL_GPL(sst_dsp_boot);