net/enic: check for unsupported flow item types
authorHyong Youb Kim <hyonkim@cisco.com>
Sat, 2 Mar 2019 10:42:43 +0000 (02:42 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 8 Mar 2019 16:52:22 +0000 (17:52 +0100)
commit4d8e9aa48328edb58f8a843a8e6bee327e12d181
tree013f27158f744a50d178a7f45e96f6c33b58896b
parente7347a8aff483f22c75491ca1d59e1f822318500
net/enic: check for unsupported flow item types

Currently a pattern with an unsupported item type causes segfault,
because the flow handler is using the type as an array index without
checking bounds. Add an explicit check for unsupported item types and
avoid out-of-bound accesses.

Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
drivers/net/enic/enic_flow.c