From: John Daley Date: Wed, 18 Apr 2018 00:00:20 +0000 (-0700) Subject: net/enic: fix uninitialized variable X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=05e8568269a01b4aa120fe558e93c40e97572895;p=dpdk.git net/enic: fix uninitialized variable A local variable was used without initialization and triggered a coverity issue. Is is fixed here, but there is no ill effect of not initializing the variable in this case. 'rxq_interrupt_offset' is irrelevant if 'rxq_interrupt_enable' is not set (the condition caught by coverity). Coverity issue: 268314 Fixes: fc2c8c0668fd ("net/enic: use Tx completion index instead of messages") Cc: stable@dpdk.org Signed-off-by: John Daley Reviewed-by: Hyong Youb Kim --- diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 822037ce86..2a2269794d 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -200,15 +200,14 @@ void enic_init_vnic_resources(struct enic *enic) unsigned int error_interrupt_enable = 1; unsigned int error_interrupt_offset = 0; unsigned int rxq_interrupt_enable = 0; - unsigned int rxq_interrupt_offset; + unsigned int rxq_interrupt_offset = ENICPMD_RXQ_INTR_OFFSET; unsigned int index = 0; unsigned int cq_idx; struct vnic_rq *data_rq; - if (enic->rte_dev->data->dev_conf.intr_conf.rxq) { + if (enic->rte_dev->data->dev_conf.intr_conf.rxq) rxq_interrupt_enable = 1; - rxq_interrupt_offset = ENICPMD_RXQ_INTR_OFFSET; - } + for (index = 0; index < enic->rq_count; index++) { cq_idx = enic_cq_rq(enic, enic_rte_rq_idx_to_sop_idx(index));