aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-11-28 13:51:37 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-11-28 14:02:07 +1100
commit6b9718b2ccd5d1ae50f33047a323acd72531fd13 (patch)
tree6bee9a625d3dbcc8955ccf219f24d6ea8128fbbe
parent132ac31c08e0f370335ccb26418a6a0944bc47e7 (diff)
Add null check for supplied Audio Path PCM opsguppy_6.99.2guppy/6.99.26.99.2
This was not being checked, and resulted in kernel panic when null Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
-rw-r--r--core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/core.c b/core.c
index a733118..c758391 100644
--- a/core.c
+++ b/core.c
@@ -242,6 +242,12 @@ static struct snd_pcm *pcm_create(struct snd_avirt_stream *stream)
pcm_ops_ap = (struct snd_pcm_ops *)audiopath->pcm_capture_ops;
capture = true;
}
+ if (!pcm_ops_ap) {
+ D_ERRORK("No PCM ops for direction '%s' for Audio Path: %s",
+ (stream->direction) ? "capture" : "playback",
+ stream->map);
+ return ERR_PTR(-EFAULT);
+ }
pcm_ops = &pcm_ops_avirt;
/* Set PCM ops for the Audio Path*/