All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qiming Yang <qiming.yang@intel.com>
To: dev@dpdk.org
Cc: Qiming Yang <qiming.yang@intel.com>, stable@dpdk.org
Subject: [PATCH] lib: add warning for NULL pointer
Date: Wed,  5 Dec 2018 19:55:31 +0800	[thread overview]
Message-ID: <20181205115531.17073-1-qiming.yang@intel.com> (raw)

May return NULL when manage tries for packet in acl library. So
this patch added warning for the NULL pointer return.

Fixes: 074f54ad03ee ("acl: fix build and runtime for default target")
Cc: stable@dpdk.org

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
---
 lib/librte_acl/acl_run.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_acl/acl_run.h b/lib/librte_acl/acl_run.h
index bf7842d..6c718c0 100644
--- a/lib/librte_acl/acl_run.h
+++ b/lib/librte_acl/acl_run.h
@@ -143,6 +143,9 @@ acl_start_next_trie(struct acl_flow_data *flows, struct parms *parms, int n,
 				flows->num_packets * flows->categories);
 		}
 
+		if (flows->last_cmplt == NULL)
+			RTE_LOG(WARNING, MALLOC, "packet tries allocate failed");
+
 		/* set completion parameters and starting index for this slot */
 		parms[n].cmplt = flows->last_cmplt;
 		transition =
-- 
2.9.5

             reply	other threads:[~2018-12-05 11:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 11:55 Qiming Yang [this message]
2018-12-05  4:37 ` [PATCH] lib: add warning for NULL pointer Varghese, Vipin
2018-12-05  5:15   ` Varghese, Vipin
2018-12-05 17:06 ` Stephen Hemminger
2019-01-14 12:39 ` Ananyev, Konstantin

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=20181205115531.17073-1-qiming.yang@intel.com \
    --to=qiming.yang@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.