From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 020ADA00BE for ; Tue, 29 Oct 2019 04:07:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B72B71BEE1; Tue, 29 Oct 2019 04:07:41 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 820211BEDA; Tue, 29 Oct 2019 04:07:38 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Oct 2019 20:07:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,242,1569308400"; d="scan'208";a="193468431" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by orsmga008.jf.intel.com with ESMTP; 28 Oct 2019 20:07:36 -0700 Date: Tue, 29 Oct 2019 11:04:06 +0800 From: Ye Xiaolong To: "Yang, Qiming" Cc: "Jiang, JunyuX" , "dev@dpdk.org" , Chas Williams , "stable@dpdk.org" Message-ID: <20191029030406.GC12923@intel.com> References: <20191024205551.26273-1-junyux.jiang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/bonding: fix segfault using invalid port X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 10/28, Yang, Qiming wrote: >Hi, Junyu > >> + dev = &rte_eth_devices[port]; >> + internals = dev->data->dev_private; >Have you build success? I think we need to add (struct bond_dev_private *) for force transfer dev_private is a void *, an explicit type conversion is not needed here. Thanks, Xiaolong > >> >> if (check_for_bonded_ethdev(dev) != 0) >> return -1; >> @@ -1689,9 +1696,14 @@ int >> rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port) { >> int retval = 0; >> - struct rte_eth_dev *dev = &rte_eth_devices[port]; >> - struct bond_dev_private *internals = (struct bond_dev_private *) >> - dev->data->dev_private; >> + struct rte_eth_dev *dev; >> + struct bond_dev_private *internals; >> + >> + if (valid_bonded_port_id(port) != 0) >> + return -EINVAL; >> + >> + dev = &rte_eth_devices[port]; >> + internals = dev->data->dev_private; >Same as before > >> >> if (check_for_bonded_ethdev(dev) != 0) >> return -1; >> -- >> 2.17.1 >