From 13469d59517fcf7f82e114ef727eb145ac49f460 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 7 Dec 2018 00:38:18 +0000 Subject: [PATCH] pipeline: check pipeline init memory allocation. Make sure we check the return value and complain if it fails. Signed-off-by: Liam Girdwood --- src/audio/pipeline.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index 7beb79277..f6d4fb65a 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -1327,5 +1327,10 @@ int pipeline_init(void) sizeof(*pipe_data)); spinlock_init(&pipe_data->lock); + if (!pipe_data) { + trace_pipe_error("failed to init pipeline"); + return -ENOMEM; + } + return 0; }