From patchwork Thu Dec 10 09:50:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Remy Horton X-Patchwork-Id: 9453 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 430158E58; Thu, 10 Dec 2015 10:50:14 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 342035A6C for ; Thu, 10 Dec 2015 10:50:11 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 10 Dec 2015 01:50:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,407,1444719600"; d="scan'208";a="870740166" Received: from rhorton-mobl.ger.corp.intel.com (HELO localhost.ir.intel.com) ([163.33.228.64]) by fmsmga002.fm.intel.com with ESMTP; 10 Dec 2015 01:50:10 -0800 From: Remy Horton To: dev@dpdk.org Date: Thu, 10 Dec 2015 09:50:06 +0000 Message-Id: <1449741007-1022-2-git-send-email-remy.horton@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1449741007-1022-1-git-send-email-remy.horton@intel.com> References: <1449741007-1022-1-git-send-email-remy.horton@intel.com> Subject: [dpdk-dev] [PATCH v1 1/2] examples/ethtool: Fix uninitialised 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix Coverity warning with uninitialised field in structure being used. Zero out all the other unused ones. >>> CID 120413 (#1 of 1): Uninitialized scalar variable (UNINIT) Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application") Signed-off-by: Remy Horton Acked-by: John McNamara --- examples/ethtool/ethtool-app/ethapp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c index 3863b02..2ed4796 100644 --- a/examples/ethtool/ethtool-app/ethapp.c +++ b/examples/ethtool/ethtool-app/ethapp.c @@ -339,6 +339,7 @@ pcmd_pause_callback(void *ptr_params, if (ptr_data != NULL) { stat = rte_ethtool_get_pauseparam(params->port, &info); } else { + memset(&info, 0, sizeof(info)); if (strcasecmp("all", params->opt) == 0) { info.tx_pause = 1; info.rx_pause = 1; @@ -352,6 +353,8 @@ pcmd_pause_callback(void *ptr_params, info.tx_pause = 0; info.rx_pause = 0; } + /* Assume auto-negotiation wanted */ + info.autoneg = 1; stat = rte_ethtool_set_pauseparam(params->port, &info); } if (stat == 0) {