From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] bond: static analysis issues fix Date: Tue, 16 Dec 2014 18:31:33 +0100 Message-ID: <2315037.U4ry1iSxen@xps13> References: <1418405982-21407-1-git-send-email-declan.doherty@intel.com> <1418663630-27409-1-git-send-email-declan.doherty@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Declan Doherty Return-path: In-Reply-To: <1418663630-27409-1-git-send-email-declan.doherty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2014-12-15 17:13, Declan Doherty: > -v2: > Incorporates Pawel's comments regarding assertion's check on activate_slave array indexing Changelog should be below three dashes to be excluded from git history. > Fixes for link bonding library identified by static analysis tool > > - Overflow assert for active_slaves array in activate_slave function > - Allocation check of pci_id_table in rte_eth_bond_create > - Use of eth_dev pointer in mac_address_get/set before NULL check Please send 3 patches. 1 bug = 1 fix with its explanation. The main advantage is to help referencing regressions. > Signed-off-by: Declan Doherty [...] > --- a/lib/librte_pmd_bond/rte_eth_bond_api.c > +++ b/lib/librte_pmd_bond/rte_eth_bond_api.c > @@ -115,8 +115,12 @@ activate_slave(struct rte_eth_dev *eth_dev, uint8_t port_id) > if (internals->mode == BONDING_MODE_8023AD) > bond_mode_8023ad_activate_slave(eth_dev, port_id); > > + RTE_VERIFY(internals->active_slave_count < > + (RTE_DIM(internals->active_slaves) - 1)); > + > internals->active_slaves[internals->active_slave_count] = port_id; > internals->active_slave_count++; > + > } Why a blank line here? -- Thomas