Skip to contentSkip to conversation

ASoC: Intel: Check ops before we derefference pointers.

PATCH Applied Jie Yang 2 participants 2 messages Jul 30, 2014

Subsystems (3)
lore
Share & tools
lore

Jie Yang

author
#0 lore raw

PATCH 1/1 ASoC: Intel: Check ops before we derefference pointers.

From: Liam Girdwood <[email protected]>

Check ops pointer members before we can derefference them.

---
 sound/soc/intel/sst-dsp.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
sound/soc/intel/sst-dsp.c +7 -3
index 0b715b2..cd23060 100644
@@ -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);
Signature · 1 line
1.8.3.2
maintainer Applied
#1 lore raw
Quoted 3 lines · Jie Yang

From: Liam Girdwood <[email protected]>

Check ops pointer members before we can derefference them.

Applied, thanks.