Skip to contentSkip to conversation

app/testpmd: fix default RX/TX flow control values

PATCH In review David Marchand 2 participants 2 messages Jun 1, 2015 – Jun 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: fix default RX/TX flow control values

From: Ding Zhi <[email protected]>

This variable has undefined values in some cases.

Fixes 422a20a4e62d ("app/testpmd: fix uninitialized flow control variables")
---
 app/test-pmd/cmdline.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
index f01db2a..aec7a0b 100644
@@ -4743,7 +4743,7 @@ cmd_link_flow_ctrl_set_parsed(void *parsed_result,
 	struct cmd_link_flow_ctrl_set_result *res = parsed_result;
 	cmdline_parse_inst_t *cmd = data;
 	struct rte_eth_fc_conf fc_conf;
-	int rx_fc_en, tx_fc_en = 0;
+	int rx_fc_en = 0, tx_fc_en = 0;
 	int ret;
 
 	/*
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 5 lines

This variable has undefined values in some cases.

Fixes 422a20a4e62d ("app/testpmd: fix uninitialized flow control variables")

[...]

app/test-pmd/cmdline.c cmd_link_flow_ctrl_set_parsed(void *parsed_result, · line 4747

Quoted 9 lines
app/test-pmd/cmdline.c +1 -1
@@ -4743,7 +4743,7 @@ cmd_link_flow_ctrl_set_parsed(void *parsed_result,
 	struct cmd_link_flow_ctrl_set_result *res = parsed_result;
 	cmdline_parse_inst_t *cmd = data;
 	struct rte_eth_fc_conf fc_conf;
-	int rx_fc_en, tx_fc_en = 0;
+	int rx_fc_en = 0, tx_fc_en = 0;
 	int ret;

Applied with lines split to conform with the coding rules:
http://dpdk.org/browse/dpdk/tree/doc/guides/guidelines/coding_style.rst#n461