From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id C669B8049 for ; Tue, 16 Dec 2014 18:31:59 +0100 (CET) Received: by mail-wi0-f177.google.com with SMTP id l15so13353088wiw.4 for ; Tue, 16 Dec 2014 09:31:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=YMZgOZtR76sH9Hjs8S/KhjWyWmiN7jQ3KXD39ktCiJI=; b=dpjmHeS6FpeKM6Ix2n+NDEzObbIleJ+Z9i0F4WM1VAmHdgM7v2HfEvIgW19PeaIpyW vdHLRQOZo6V6biYjVuhOWu6jypZQJNGQrKzFbf42yk9ppzBIzRwXTvxOydPox31nL7++ BaO2EPy7KwyYguXQ6lckB7kDxse+v/c+EiyzPceaSLeTwTFBzm45JvGVsV07vB/4EjH0 /unRwhhma3EOGq9Pdq1HnYHl8wUU+hTLZqqn1wzQOBhTIPaF8xOo3Ufuy8sRaka9Qq7s AdDk81E+fO7w+LF4J/UwidBb7bge1sfeZdcMp8Vy5fTKiaQwulsVRLfo/lJ1OMCDENCS qKDA== X-Gm-Message-State: ALoCoQlsDsm1X8w2ssCzCak/pb0khNKqIuIDNjnPlxEYhrsbuXQDYmXzUHb1iwE9PB3xK58aQWK6 X-Received: by 10.180.9.241 with SMTP id d17mr1437574wib.13.1418751119616; Tue, 16 Dec 2014 09:31:59 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id eu15sm2902811wid.18.2014.12.16.09.31.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 09:31:58 -0800 (PST) From: Thomas Monjalon To: Declan Doherty Date: Tue, 16 Dec 2014 18:31:33 +0100 Message-ID: <2315037.U4ry1iSxen@xps13> Organization: 6WIND User-Agent: KMail/4.14.3 (Linux/3.17.4-1-ARCH; KDE/4.14.3; x86_64; ; ) In-Reply-To: <1418663630-27409-1-git-send-email-declan.doherty@intel.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] bond: static analysis issues fix X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 17:32:00 -0000 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