summaryrefslogtreecommitdiff
path: root/examples/ethtool
diff options
context:
space:
mode:
authorRemy Horton <remy.horton@intel.com>2015-12-10 09:50:06 +0000
committerThomas Monjalon <thomas.monjalon@6wind.com>2015-12-10 22:26:49 +0100
commitc98e8f3932d88f77c7f1acd7551406200795c5aa (patch)
tree16ed9ee4b215602caef28e738ed64841c69dd659 /examples/ethtool
parent2704ad28ade10ea505e8827d1d0023ca84f40d23 (diff)
downloaddpdk-c98e8f3932d88f77c7f1acd7551406200795c5aa.zip
dpdk-c98e8f3932d88f77c7f1acd7551406200795c5aa.tar.gz
dpdk-c98e8f3932d88f77c7f1acd7551406200795c5aa.tar.xz
examples/ethtool: fix uninitialised variable
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 <remy.horton@intel.com> Acked-by: John McNamara <john.mcnamara@intel.com>
Diffstat (limited to 'examples/ethtool')
-rw-r--r--examples/ethtool/ethtool-app/ethapp.c3
1 files changed, 3 insertions, 0 deletions
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) {