From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 42EE49ADB for ; Thu, 26 Mar 2015 02:05:11 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 25 Mar 2015 18:05:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,468,1422950400"; d="scan'208";a="670702014" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by orsmga001.jf.intel.com with ESMTP; 25 Mar 2015 18:05:09 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 26 Mar 2015 09:03:10 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.149]) by shsmsx102.ccr.corp.intel.com ([169.254.2.198]) with mapi id 14.03.0224.002; Thu, 26 Mar 2015 09:03:09 +0800 From: "Zhang, Helin" To: "Wu, Jingjing" , "dev@dpdk.org" Thread-Topic: [PATCH] i40e: zero local variable Thread-Index: AQHQZ0QGNIG+vXLgIky/wP9+1mt21Z0t8peQ Date: Thu, 26 Mar 2015 01:03:08 +0000 Message-ID: References: <1427319492-943-1-git-send-email-jingjing.wu@intel.com> In-Reply-To: <1427319492-943-1-git-send-email-jingjing.wu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] i40e: zero local variable 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: Thu, 26 Mar 2015 01:05:11 -0000 > -----Original Message----- > From: Wu, Jingjing > Sent: Thursday, March 26, 2015 5:38 AM > To: dev@dpdk.org > Cc: Wu, Jingjing; Zhang, Helin; Cao, Min > Subject: [PATCH] i40e: zero local variable >=20 > This patch sets the local variable ctxt to zero to avoid uncertain data c= auses > error when creating a vsi for flow director. >=20 > Signed-off-by: Jingjing Wu Acked-by: Helin Zhang > --- > lib/librte_pmd_i40e/i40e_ethdev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > b/lib/librte_pmd_i40e/i40e_ethdev.c > index cf6685e..80fc432 100644 > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > @@ -3120,6 +3120,7 @@ i40e_vsi_setup(struct i40e_pf *pf, > ctxt.info.valid_sections |=3D > rte_cpu_to_le_16(I40E_AQ_VSI_PROP_SCHED_VALID); > } else if (type =3D=3D I40E_VSI_FDIR) { > + memset(&ctxt, 0, sizeof(ctxt)); > vsi->uplink_seid =3D uplink_vsi->uplink_seid; > ctxt.pf_num =3D hw->pf_id; > ctxt.vf_num =3D 0; > @@ -3143,7 +3144,7 @@ i40e_vsi_setup(struct i40e_pf *pf, >=20 > if (vsi->type !=3D I40E_VSI_MAIN) { > ret =3D i40e_aq_add_vsi(hw, &ctxt, NULL); > - if (ret) { > + if (ret !=3D I40E_SUCCESS) { > PMD_DRV_LOG(ERR, "add vsi failed, aq_err=3D%d", > hw->aq.asq_last_status); > goto fail_msix_alloc; > -- > 1.9.3