DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Helin" <helin.zhang@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/6] i40e: fix problematic dereference
Date: Fri, 22 Apr 2016 01:04:04 +0000	[thread overview]
Message-ID: <F35DEAC7BCE34641BA9FAC6BCA4A12E70AA12259@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <20160421091019.348a1777@xeon-e3>



> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Friday, April 22, 2016 12:10 AM
> To: Zhang, Helin <helin.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/6] i40e: fix problematic dereference
> 
> On Thu, 21 Apr 2016 11:42:52 +0800
> Helin Zhang <helin.zhang@intel.com> wrote:
> 
> > Fix issue reported by Coverity.
> >
> > Coverity ID 119267: Dereference before null check.
> >
> > Fixes: 8e109464c022 ("i40e: allow vector Rx and Tx usage")
> >
> > Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> > ---
> >  drivers/net/i40e/i40e_rxtx.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_rxtx.c
> > b/drivers/net/i40e/i40e_rxtx.c index 4d35d83..9c126a3 100644
> > --- a/drivers/net/i40e/i40e_rxtx.c
> > +++ b/drivers/net/i40e/i40e_rxtx.c
> > @@ -2592,14 +2592,14 @@ i40e_rx_queue_release_mbufs(struct
> > i40e_rx_queue *rxq)  {
> >  	uint16_t i;
> >
> > -	/* SSE Vector driver has a different way of releasing mbufs. */
> > -	if (rxq->rx_using_sse) {
> > -		i40e_rx_queue_release_mbufs_vec(rxq);
> > +	if (!rxq || !rxq->sw_ring) {
> > +		PMD_DRV_LOG(DEBUG, "Pointer to rxq or sw_ring is NULL");
> >  		return;
> >  	}
> >
> 
> I can't see how you could ever trigger this.
>  i40e_rx_queue_release_mbufs() is called only called from places where rxq is
> guraanteed non NULL.
> 
> Are you sure Coverity isn't tell you that?
Coverity just reported " Dereference before null check ", nothing else there.
The function was called several times in different places. It could be safer, in case
somebody wrongly give the queue id.
But you are right, it shouldn't happen if nothing wrong.

Are you suggesting to remove rxq check? Thanks!

Regards,
Helin

  reply	other threads:[~2016-04-22  1:04 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-21  3:42 [dpdk-dev] [PATCH 0/6] fix i40e " Helin Zhang
2016-04-21  3:42 ` [dpdk-dev] [PATCH 1/6] i40e: fix " Helin Zhang
2016-04-21 16:10   ` Stephen Hemminger
2016-04-22  1:04     ` Zhang, Helin [this message]
2016-04-21  3:42 ` [dpdk-dev] [PATCH 2/6] " Helin Zhang
2016-04-21  3:42 ` [dpdk-dev] [PATCH 3/6] " Helin Zhang
2016-04-21  3:42 ` [dpdk-dev] [PATCH 4/6] " Helin Zhang
2016-04-21  3:42 ` [dpdk-dev] [PATCH 5/6] " Helin Zhang
2016-04-21  3:42 ` [dpdk-dev] [PATCH 6/6] " Helin Zhang
2016-04-21 10:06 ` [dpdk-dev] [PATCH 0/6] fix i40e " Thomas Monjalon
2016-04-21 12:49   ` Zhang, Helin
2016-04-21 12:51     ` Thomas Monjalon
2016-04-21 11:01 ` Bruce Richardson
2016-04-21 12:50   ` Zhang, Helin
2016-04-25  5:44 ` [dpdk-dev] [PATCH v2] i40e: fix " Helin Zhang
2016-04-25  9:41   ` Bruce Richardson
2016-04-28  3:17   ` [dpdk-dev] [PATCH v3 0/2] fix Coverity reported issues Helin Zhang
2016-04-28  3:17   ` [dpdk-dev] [PATCH v3 1/2] i40e: fix problematic dereference Helin Zhang
2016-04-28  3:17   ` [dpdk-dev] [PATCH v3 2/2] i40e: fix missing break in switch Helin Zhang
2016-06-26 15:46 ` [dpdk-dev] [PATCH v2 0/2] fix coverity issues Helin Zhang
2016-06-26 15:46   ` [dpdk-dev] [PATCH v2 1/2] i40e: fix problematic dereference Helin Zhang
2016-06-26 20:04     ` Mcnamara, John
2016-06-26 15:46   ` [dpdk-dev] [PATCH v2 2/2] i40e: fix missing break in switch Helin Zhang
2016-06-26 20:04     ` Mcnamara, John
2016-06-28 12:01   ` [dpdk-dev] [PATCH v2 0/2] fix coverity issues Bruce Richardson

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=F35DEAC7BCE34641BA9FAC6BCA4A12E70AA12259@SHSMSX103.ccr.corp.intel.com \
    --to=helin.zhang@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).