Skip to content

Commit

Permalink
ASoC: Intel: Check ops before we derefference pointers.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Liam Girdwood authored and Mark Brown committed Jul 30, 2014
1 parent 543ec63 commit 30bba67
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sound/soc/intel/sst-dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 30bba67

Please sign in to comment.