DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Su, Simei" <simei.su@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Guo, Junfeng" <junfeng.guo@intel.com>,
	"Guo, Jia" <jia.guo@intel.com>,
	"Cao, Yahui" <yahui.cao@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/iavf: fix null pointer dereference
Date: Thu, 14 Jan 2021 07:53:18 +0000	[thread overview]
Message-ID: <98cabc6a021b4a7b9d14533799702f2e@intel.com> (raw)
In-Reply-To: <20210114052324.393980-1-simei.su@intel.com>



> -----Original Message-----
> From: Su, Simei <simei.su@intel.com>
> Sent: Thursday, January 14, 2021 1:23 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Guo, Junfeng <junfeng.guo@intel.com>; Guo, Jia
> <jia.guo@intel.com>; Cao, Yahui <yahui.cao@intel.com>; Su, Simei
> <simei.su@intel.com>
> Subject: [PATCH] net/iavf: fix null pointer dereference
> 
> A pointer has already been dereferenced before checking if it is NULL.
> It doesn't make any sense, so correct to avoid it.
> 
> Fixes: 4f3cfcbc3df3 ("net/iavf: support eCPRI msg type 0 for RSS") Coverity issue:
> 365290
> 
> Signed-off-by: Simei Su <simei.su@intel.com>
> ---
>  drivers/net/iavf/iavf_hash.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index
> ebaac58..9901f4b 100644
> --- a/drivers/net/iavf/iavf_hash.c
> +++ b/drivers/net/iavf/iavf_hash.c
> @@ -597,11 +597,13 @@ iavf_hash_parse_pattern(const struct rte_flow_item
> pattern[], uint64_t *phint,
>  			break;
>  		case RTE_FLOW_ITEM_TYPE_ECPRI:
>  			ecpri = item->spec;
> -			ecpri_common.u32 = rte_be_to_cpu_32(
> -						ecpri->hdr.common.u32);
>  			if (!ecpri)
>  				break;
> -			else if (ecpri_common.type !=
> +
> +			ecpri_common.u32 = rte_be_to_cpu_32(
> +						ecpri->hdr.common.u32);

patchwork warning CHECK:OPEN_ENDED_LINE for above code 
As we have 100 char line limit now, the wrap is not necessary.

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel after capture above fix.

Thanks
Qi

      reply	other threads:[~2021-01-14  7:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14  5:23 Simei Su
2021-01-14  7:53 ` Zhang, Qi Z [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=98cabc6a021b4a7b9d14533799702f2e@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=jia.guo@intel.com \
    --cc=junfeng.guo@intel.com \
    --cc=simei.su@intel.com \
    --cc=yahui.cao@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).