net/igb: fix access bound in ethertype filter
authorKuba Kozak <kubax.kozak@intel.com>
Tue, 25 Jul 2017 12:19:25 +0000 (14:19 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 31 Jul 2017 17:58:41 +0000 (19:58 +0200)
Fix wrong structure type used as argument in memset() call.

Coverity issue: 147223
Coverity issue: 147227
Fixes: a8600af43738 ("net/igb: parse flow API ethertype filter")
Fixes: 22bb13410cb2 ("net/igb: create consistent filter")
Cc: stable@dpdk.org
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
drivers/net/e1000/igb_flow.c

index db73b18..ed2ecc4 100644 (file)
@@ -694,7 +694,8 @@ igb_parse_ethertype_filter(struct rte_eth_dev *dev,
 
        if (hw->mac.type == e1000_82576) {
                if (filter->queue >= IGB_MAX_RX_QUEUE_NUM_82576) {
-                       memset(filter, 0, sizeof(struct rte_eth_ntuple_filter));
+                       memset(filter, 0, sizeof(
+                                       struct rte_eth_ethertype_filter));
                        rte_flow_error_set(error, EINVAL,
                                RTE_FLOW_ERROR_TYPE_ITEM,
                                NULL, "queue number not supported "
@@ -703,7 +704,8 @@ igb_parse_ethertype_filter(struct rte_eth_dev *dev,
                }
        } else {
                if (filter->queue >= IGB_MAX_RX_QUEUE_NUM) {
-                       memset(filter, 0, sizeof(struct rte_eth_ntuple_filter));
+                       memset(filter, 0, sizeof(
+                                       struct rte_eth_ethertype_filter));
                        rte_flow_error_set(error, EINVAL,
                                RTE_FLOW_ERROR_TYPE_ITEM,
                                NULL, "queue number not supported "