From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] ethdev: fix build with gcc 5.4.0 Date: Thu, 13 Jul 2017 11:35:58 +0200 Message-ID: <2333451.97DFAzsifD@xps> References: <20170706214532.31274-1-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit To: dev@dpdk.org, Matan Azrad Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 4FF9D2935 for ; Thu, 13 Jul 2017 11:36:00 +0200 (CEST) In-Reply-To: <20170706214532.31274-1-thomas@monjalon.net> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 06/07/2017 23:45, Thomas Monjalon: > Seen on Ubuntu 16.04 with GCC 5.4.0: > > lib/librte_ether/rte_ethdev.c: In function 'get_mac_addr_index': > lib/librte_ether/rte_ethdev.c:2369:26: error: > 'dev_info.max_mac_addrs' may be used uninitialized in this function > > Indeed, rte_eth_dev_info_get() do not write into dev_info > if the port_id is not valid. > So we need to check the port_id and return in case of error. > > This extra check should not be needed because the port_id is always > checked before calling get_mac_addr_index(). > However it does not hurt. > > Reported-by: Matan Azrad > Signed-off-by: Thomas Monjalon > Tested-by: Matan Azrad Applied