From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A68332081E; Thu, 13 Jul 2017 05:35:59 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 13 Jul 2017 05:35:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=ntYWzWn8p2I2M0Y eaU1W4CqkIVlaUISSoNO0juPYj64=; b=Mo2ZkBUApM2bwpmxpaYKmeymgru63zy 6sknOnfb7N+RxeGgLq63qSxaMHRHja2JQMKRvilqZZEEeqStDAyLfWJtvhX8JkLV Sh6EZg/AhxwisPeVWFNSO84rtF6WsLTguZDyuFZntV/M2eETWi9eZnTKJdB8Gpwd xn3H52vJXso8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=ntYWzWn8p2I2M0YeaU1W4CqkIVlaUISSoNO0juPYj64=; b=HhpMRImc CV9mUAudjoGm6/rxQsLXgBb4R6nGZvLqXMYuWu7Oh4nlC4zS1DlucS0ZJ1DOjmgH x2RNaYacBQURhkrT3cFpARc6zntGaslEYyvv9XynQ5VKjCmrFdYDEA8roLSTVrRA sd1x50E9FcbSGIqtaZ8pB3I/D+vlwdhXO5/l6nI1b24Vk0L1AssPRPcTP+wCPAgV 8xgeNbquFj0Zkth1YciFfq/6+HOxjPCYq0L6ubXOCKEmrptbyJvESn4PesnRPzGx DmtMv38HiVdLGXdpjw9tIZFNJVuhhXWV9C4VbxVRltRawZfl7gvw9qUK3hVTC6w7 dMZVnFd8uRj+vQ== X-ME-Sender: X-Sasl-enc: AQKyC1I0c/MPeomraAIjDHtfa3p43DQuwAEOaQ+WUL86 1499938559 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 4F99C7E46B; Thu, 13 Jul 2017 05:35:59 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org, Matan Azrad Date: Thu, 13 Jul 2017 11:35:58 +0200 Message-ID: <2333451.97DFAzsifD@xps> In-Reply-To: <20170706214532.31274-1-thomas@monjalon.net> References: <20170706214532.31274-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] ethdev: fix build with gcc 5.4.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jul 2017 09:36:00 -0000 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