DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH 2/3] app/test_bpf: don't print eBPF program if NULL
Date: Fri, 11 Feb 2022 11:02:55 +0000	[thread overview]
Message-ID: <DM6PR11MB44918D00C37835A4B1351DCB9A309@DM6PR11MB4491.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220210230906.833163-3-stephen@networkplumber.org>


> If conversion of cBPF to eBPF fails (in rte_bpf_convert)
> then the test should not try and print the result.
> 
> Coverity issue: 373661
> Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  app/test/test_bpf.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c
> index d1e10adab545..805cce640667 100644
> --- a/app/test/test_bpf.c
> +++ b/app/test/test_bpf.c
> @@ -3273,8 +3273,10 @@ test_bpf_dump(struct bpf_program *cbf, const struct rte_bpf_prm *prm)
>  	printf("cBPF program (%u insns)\n", cbf->bf_len);
>  	bpf_dump(cbf, 1);
> 
> -	printf("\neBPF program (%u insns)\n", prm->nb_ins);
> -	rte_bpf_dump(stdout, prm->ins, prm->nb_ins);
> +	if (prm != NULL) {
> +		printf("\neBPF program (%u insns)\n", prm->nb_ins);
> +		rte_bpf_dump(stdout, prm->ins, prm->nb_ins);
> +	}
>  }
> 
>  static int
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.34.1


  reply	other threads:[~2022-02-11 11:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 23:09 [PATCH 0/3] small fixes suggested by Coverity scan Stephen Hemminger
2022-02-10 23:09 ` [PATCH 1/3] pcapng: handle rte_ethlink_get failing Stephen Hemminger
2022-02-10 23:09 ` [PATCH 2/3] app/test_bpf: don't print eBPF program if NULL Stephen Hemminger
2022-02-11 11:02   ` Ananyev, Konstantin [this message]
2022-02-10 23:09 ` [PATCH 3/3] app/dumpcap: check for failure to set promiscious Stephen Hemminger
2022-03-08  8:20 ` [PATCH 0/3] small fixes suggested by Coverity scan 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=DM6PR11MB44918D00C37835A4B1351DCB9A309@DM6PR11MB4491.namprd11.prod.outlook.com \
    --to=konstantin.ananyev@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.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).