From: Stephen Hemminger Date: Thu, 5 Apr 2018 15:12:28 +0000 (-0700) Subject: net/octeontx: fix uninitialized speed variable X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3a4b87c897d6e746ce53bcbe70a35e44654c7434;p=dpdk.git 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 --- 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; }