net/avf: fix uninitialized variables
authorJingjing Wu <jingjing.wu@intel.com>
Tue, 30 Jan 2018 03:32:58 +0000 (11:32 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 31 Jan 2018 19:57:29 +0000 (20:57 +0100)
This patch fixes the coverity UNINIT issue.

Coverity issue: 257016, 257036
Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
drivers/net/avf/avf_ethdev.c

index 3f210b2..4df6617 100644 (file)
@@ -191,7 +191,7 @@ avf_init_rss(struct avf_adapter *adapter)
                                   vf->vf_res->rss_key_size));
 
        /* init RSS LUT table */
-       for (i = 0; i < vf->vf_res->rss_lut_size; i++, j++) {
+       for (i = 0, j = 0; i < vf->vf_res->rss_lut_size; i++, j++) {
                if (j >= nb_q)
                        j = 0;
                vf->rss_lut[i] = j;
@@ -763,10 +763,10 @@ avf_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask)
                        err = avf_enable_vlan_strip(adapter);
                else
                        err = avf_disable_vlan_strip(adapter);
-       }
 
-       if (err)
-               return -EIO;
+               if (err)
+                       return -EIO;
+       }
        return 0;
 }