diff options
author | Liam Girdwood <liam.r.girdwood@linux.intel.com> | 2014-07-30 08:18:32 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-30 08:24:21 -0400 |
commit | 30bba67c43c0dd36696d1209c19afc3f25f2f3f3 (patch) | |
tree | b63eab449330ebadb9d50e098b166a515072821a /sound/soc/intel | |
parent | 543ec637e00a9000772c315a8c98fa6ede563c5b (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.c | 10 |
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 | ||
225 | void sst_dsp_dump(struct sst_dsp *sst) | 225 | void 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 | } |
229 | EXPORT_SYMBOL_GPL(sst_dsp_dump); | 230 | EXPORT_SYMBOL_GPL(sst_dsp_dump); |
230 | 231 | ||
231 | void sst_dsp_reset(struct sst_dsp *sst) | 232 | void 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 | } |
235 | EXPORT_SYMBOL_GPL(sst_dsp_reset); | 237 | EXPORT_SYMBOL_GPL(sst_dsp_reset); |
236 | 238 | ||
237 | int sst_dsp_boot(struct sst_dsp *sst) | 239 | int 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 | } |
242 | EXPORT_SYMBOL_GPL(sst_dsp_boot); | 246 | EXPORT_SYMBOL_GPL(sst_dsp_boot); |