From 3a4b87c897d6e746ce53bcbe70a35e44654c7434 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 5 Apr 2018 08:12:28 -0700 Subject: [PATCH] net/octeontx: fix uninitialized speed variable This is fix for Coverity Defect 268319 about uninitialized speed in an error case. Also drop unnecessary assignment. Coverity issue: 268319 Fixes: 4fac7c0a147e ("net/octeontx: add link update") CC: stable@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Jerin Jacob --- drivers/net/octeontx/octeontx_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 15da4eacae..1406e4e19d 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -524,7 +524,6 @@ octeontx_dev_link_update(struct rte_eth_dev *dev, struct rte_eth_link link; int res; - res = 0; PMD_INIT_FUNC_TRACE(); res = octeontx_port_link_status(nic); @@ -558,6 +557,7 @@ octeontx_dev_link_update(struct rte_eth_dev *dev, case OCTEONTX_LINK_SPEED_RESERVE1: case OCTEONTX_LINK_SPEED_RESERVE2: default: + link.link_speed = ETH_SPEED_NUM_NONE; octeontx_log_err("incorrect link speed %d", nic->speed); break; } -- 2.20.1