DPDK patches and discussions
 help / color / mirror / Atom feed
From: Marcin Kerlin <marcinx.kerlin@intel.com>
To: dev@dpdk.org
Cc: piotrx.t.azarewicz@intel.com, cristian.dumitrescu@intel.com,
	Marcin Kerlin <marcinx.kerlin@intel.com>
Subject: [dpdk-dev] [PATCH 1/1] ip_pipeline: fix null pointer dereference
Date: Mon, 13 Jun 2016 11:35:48 +0200	[thread overview]
Message-ID: <1465810549-19097-1-git-send-email-marcinx.kerlin@intel.com> (raw)

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 <marcinx.kerlin@intel.com>
---
 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

             reply	other threads:[~2016-06-13  8:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13  9:35 Marcin Kerlin [this message]
2016-06-13 11:20 ` Dumitrescu, Cristian
2016-06-14 19:10   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465810549-19097-1-git-send-email-marcinx.kerlin@intel.com \
    --to=marcinx.kerlin@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=piotrx.t.azarewicz@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).