From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Yang, Qiming" <qiming.yang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Yang, Qiming" <qiming.yang@intel.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] lib: add warning for NULL pointer
Date: Mon, 14 Jan 2019 12:39:02 +0000 [thread overview]
Message-ID: <2601191342CEEE43887BDE71AB977258010D903A01@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <20181205115531.17073-1-qiming.yang@intel.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiming Yang
> Sent: Wednesday, December 5, 2018 11:56 AM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] lib: add warning for NULL pointer
>
> 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");
> +
alloc_completion() should never retrun NULL
(unless something is totally broken).
So no need to handle such situation.
If you desire - feel free to add
RTE_ASSERT(flows->last_cmplt != NULL)
here.
Konstantin
> /* set completion parameters and starting index for this slot */
> parms[n].cmplt = flows->last_cmplt;
> transition =
> --
> 2.9.5
prev parent reply other threads:[~2019-01-14 12:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 11:55 [dpdk-stable] " Qiming Yang
2018-12-05 4:37 ` [dpdk-stable] [dpdk-dev] " Varghese, Vipin
2018-12-05 5:15 ` Varghese, Vipin
2018-12-05 17:06 ` Stephen Hemminger
2019-01-14 12:39 ` Ananyev, Konstantin [this message]
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=2601191342CEEE43887BDE71AB977258010D903A01@irsmsx105.ger.corp.intel.com \
--to=konstantin.ananyev@intel.com \
--cc=dev@dpdk.org \
--cc=qiming.yang@intel.com \
--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 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).