DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Kovacevic, Marko" <marko.kovacevic@intel.com>
To: "Zhang, Roy Fan" <roy.fan.zhang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "akhil.goyal@nxp.com" <akhil.goyal@nxp.com>,
	"Zhang, Roy Fan" <roy.fan.zhang@intel.com>
Subject: Re: [dpdk-dev] [PATCH] examples/fips_validation: fix logically dead code
Date: Mon, 17 Jun 2019 11:10:08 +0000	[thread overview]
Message-ID: <6DC05C7C5F25994B81B3F2F214251F66020F8308@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <20190515154121.75459-1-roy.fan.zhang@intel.com>

> Subject: [dpdk-dev] [PATCH] examples/fips_validation: fix logically dead
> code
> 
> Coverity issue: 336866
> Coverity issue: 336841
> Coverity issue: 336838
> Fixes: 41d561cbdd24 ("examples/fips_validation: add power on self test")
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> ---
>  examples/fips_validation/fips_dev_self_test.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/examples/fips_validation/fips_dev_self_test.c
> b/examples/fips_validation/fips_dev_self_test.c
> index df1c0e82e..444bbaa79 100644
> --- a/examples/fips_validation/fips_dev_self_test.c
> +++ b/examples/fips_validation/fips_dev_self_test.c
> @@ -1333,6 +1333,9 @@ check_cipher_result(struct rte_crypto_op *op,
>  	uint32_t len, src_len;
>  	int ret;
> 
> +	if (!mbuf)
> +		return -1;
> +
>  	if (dir == self_test_dir_enc_auth_gen) {
>  		src = vec->output.data;
>  		src_len = vec->output.len;
> @@ -1342,7 +1345,7 @@ check_cipher_result(struct rte_crypto_op *op,
>  	}
> 
>  	GET_MBUF_DATA(data, len, mbuf);
> -	if (!data && !len)
> +	if (!len)
>  		return -1;
> 
>  	ret = memcmp(data, src, src_len);
> @@ -1362,8 +1365,11 @@ check_auth_result(struct rte_crypto_op *op,
>  	uint32_t len;
>  	int ret;
> 
> +	if (mbuf == NULL)
> +		return -1;
> +
>  	GET_MBUF_DATA(data, len, mbuf);
> -	if (!data && !len)
> +	if (!len)
>  		return -1;
> 
>  	if (dir == self_test_dir_enc_auth_gen) { @@ -1387,6 +1393,9 @@
> check_aead_result(struct rte_crypto_op *op,
>  	uint32_t len, src_len;
>  	int ret;
> 
> +	if (!mbuf)
> +		return -1;
> +
>  	if (op->sym->aead.aad.data)
>  		rte_free(op->sym->aead.aad.data);
> 
> @@ -1399,7 +1408,7 @@ check_aead_result(struct rte_crypto_op *op,
>  	}
> 
>  	GET_MBUF_DATA(data, len, mbuf);
> -	if (!data && !len)
> +	if (!len)
>  		return -1;
> 
>  	ret = memcmp(data, src, src_len);
> --

Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>

  parent reply	other threads:[~2019-06-17 11:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15 15:41 Fan Zhang
2019-05-15 15:41 ` Fan Zhang
2019-06-17 11:10 ` Kovacevic, Marko [this message]
2019-06-19 14:56   ` Akhil Goyal

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=6DC05C7C5F25994B81B3F2F214251F66020F8308@IRSMSX104.ger.corp.intel.com \
    --to=marko.kovacevic@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=roy.fan.zhang@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).