DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Walsh, Conor" <conor.walsh@intel.com>
To: "Wang, Haiyue" <haiyue.wang@intel.com>,
	"Guo, Jia" <jia.guo@intel.com>,
	"Yigit, Ferruh" <ferruh.yigit@intel.com>,
	"Awal, Mohammad Abdul" <mohammad.abdul.awal@intel.com>,
	"Doherty, Declan" <declan.doherty@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] net/ixgbe: fix unchecked return value
Date: Tue, 20 Oct 2020 09:07:49 +0000
Message-ID: <DM5PR1101MB2121BE5910307E001F14B49BFF1F0@DM5PR1101MB2121.namprd11.prod.outlook.com> (raw)
In-Reply-To: <BN8PR11MB37956FB288BFF1DD254EFB3FF71F0@BN8PR11MB3795.namprd11.prod.outlook.com>

Thanks Haiyue,

I will implement a v2, following your suggestions.

/Conor.

> -----Original Message-----
> From: Wang, Haiyue <haiyue.wang@intel.com>
> Sent: Tuesday 20 October 2020 09:34
> To: Walsh, Conor <conor.walsh@intel.com>; Guo, Jia <jia.guo@intel.com>;
> Yigit, Ferruh <ferruh.yigit@intel.com>; Awal, Mohammad Abdul
> <mohammad.abdul.awal@intel.com>; Doherty, Declan
> <declan.doherty@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH 1/2] net/ixgbe: fix unchecked return value
> 
> > -----Original Message-----
> > From: Walsh, Conor <conor.walsh@intel.com>
> > Sent: Monday, October 19, 2020 20:26
> > To: Guo, Jia <jia.guo@intel.com>; Wang, Haiyue
> <haiyue.wang@intel.com>; Yigit, Ferruh
> > <ferruh.yigit@intel.com>; Awal, Mohammad Abdul
> <mohammad.abdul.awal@intel.com>; Doherty, Declan
> > <declan.doherty@intel.com>
> > Cc: dev@dpdk.org; Walsh, Conor <conor.walsh@intel.com>
> > Subject: [PATCH 1/2] net/ixgbe: fix unchecked return value
> >
> > The return value of rte_eth_switch_domain_alloc() was not being checked
> > within ixgbe_pf_host_init() which caused a coverity issue. If the call
> > fails a warning is logged using PMD_INIT_LOG() and *vfinfo is free'd.
> > ixgbe_pf_host_init() now has a return value which is checked in
> > eth_ixgbe_dev_init()
> >
> > Coverity issue: 362795
> > Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports")
> >
> > Signed-off-by: Conor Walsh <conor.walsh@intel.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_ethdev.c |  6 ++++--
> >  drivers/net/ixgbe/ixgbe_ethdev.h |  2 +-
> >  drivers/net/ixgbe/ixgbe_pf.c     | 16 +++++++++++++---
> >  3 files changed, 18 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> > index 14a254ab74..49ff523ea8 100644
> > --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> > +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> > @@ -1077,7 +1077,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev
> *eth_dev, void *init_params __rte_unused)
> >  		IXGBE_DEV_PRIVATE_TO_BW_CONF(eth_dev->data-
> >dev_private);
> >  	uint32_t ctrl_ext;
> >  	uint16_t csum;
> > -	int diag, i;
> > +	int diag, i, ret;
> >
> >  	PMD_INIT_FUNC_TRACE();
> >
> > @@ -1256,7 +1256,9 @@ eth_ixgbe_dev_init(struct rte_eth_dev
> *eth_dev, void *init_params __rte_unused)
> >  	memset(hwstrip, 0, sizeof(*hwstrip));
> >
> >  	/* initialize PF if max_vfs not zero */
> > -	ixgbe_pf_host_init(eth_dev);
> > +	ret = ixgbe_pf_host_init(eth_dev);
> > +	if (ret)
> > +		return ret;
> >
> 
> Seems that just return is not enough, the eth_dev->data->mac_addrs and
> eth_dev->data->hash_mac_addrs
> also needs to be freed, please refer to ' ice_dev_init':
> 
> static int
> ice_dev_init(struct rte_eth_dev *dev)
> 
> 	rte_free(dev->data->mac_addrs);
> 	dev->data->mac_addrs = NULL;
> 
> 
> > --
> > 2.25.1


  reply	other threads:[~2020-10-20  9:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 12:26 [dpdk-dev] [PATCH 0/2] net/ixgbe fix unchecked return value and rte_panic Conor Walsh
2020-10-19 12:26 ` [dpdk-dev] [PATCH 1/2] net/ixgbe: fix unchecked return value Conor Walsh
2020-10-20  8:33   ` Wang, Haiyue
2020-10-20  9:07     ` Walsh, Conor [this message]
2020-10-19 12:26 ` [dpdk-dev] [PATCH 2/2] net/ixgbe: remove rte_panic Conor Walsh
2020-10-20 10:02 ` [dpdk-dev] [PATCH v2 0/2] net/ixgbe fix unchecked return value and rte_panic Conor Walsh
2020-10-20 10:02   ` [dpdk-dev] [PATCH v2 1/2] net/ixgbe: fix unchecked return value Conor Walsh
2020-10-20 17:05     ` Wang, Haiyue
2020-10-23  0:59       ` Zhang, Qi Z
2020-10-20 10:02   ` [dpdk-dev] [PATCH v2 2/2] net/ixgbe: remove rte_panic Conor Walsh
2020-10-20 17:06     ` Wang, Haiyue
2020-10-23  0:59       ` Zhang, Qi Z

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=DM5PR1101MB2121BE5910307E001F14B49BFF1F0@DM5PR1101MB2121.namprd11.prod.outlook.com \
    --to=conor.walsh@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=haiyue.wang@intel.com \
    --cc=jia.guo@intel.com \
    --cc=mohammad.abdul.awal@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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git