From 5fdb6c362182f4177a7dfe0e03ab88c936f74085 Mon Sep 17 00:00:00 2001 From: Marcin Kerlin Date: Mon, 13 Jun 2016 11:35:48 +0200 Subject: [PATCH] examples/ip_pipeline: fix null pointer dereference Return value of function app_pipeline_type_find is not checking before dereference. Fix this problem by adding checking condition. Coverity issue: 127196 Fixes: b4aee0fb9c6d ("examples/ip_pipeline: reconfigure thread binding dynamically") Signed-off-by: Marcin Kerlin Acked-by: Cristian Dumitrescu --- examples/ip_pipeline/thread_fe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/ip_pipeline/thread_fe.c b/examples/ip_pipeline/thread_fe.c index d1b72b4ee7..6c547ca5bc 100644 --- a/examples/ip_pipeline/thread_fe.c +++ b/examples/ip_pipeline/thread_fe.c @@ -81,6 +81,9 @@ app_pipeline_enable(struct app_params *app, p_params = &app->pipeline_params[pipeline_id]; p_type = app_pipeline_type_find(app, p_params->type); + if (p_type == NULL) + return -1; + if (p->enabled == 1) return -1; -- 2.20.1