From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9EC9A5320 for ; Mon, 13 Jun 2016 10:24:56 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 13 Jun 2016 01:24:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,466,1459839600"; d="scan'208";a="996405256" Received: from gklab-246-021.igk.intel.com (HELO HANLANCREEK9755-232) ([10.217.246.21]) by orsmga002.jf.intel.com with SMTP; 13 Jun 2016 01:24:53 -0700 Received: by HANLANCREEK9755-232 (sSMTP sendmail emulation); Mon, 13 Jun 2016 11:35:52 +0200 From: Marcin Kerlin To: dev@dpdk.org Cc: piotrx.t.azarewicz@intel.com, cristian.dumitrescu@intel.com, Marcin Kerlin Date: Mon, 13 Jun 2016 11:35:48 +0200 Message-Id: <1465810549-19097-1-git-send-email-marcinx.kerlin@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH 1/1] ip_pipeline: fix null pointer dereference X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 08:24:57 -0000 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 --- 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 d1b72b4..6c547ca 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; -- 1.9.1