net/ice: fix hash flow crash
authorTao Zhu <taox.zhu@intel.com>
Tue, 3 Mar 2020 05:38:46 +0000 (13:38 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 18 Mar 2020 09:21:41 +0000 (10:21 +0100)
commitf761def5125cf7dc23a15eb2bf57206f5930801e
tree73bef67747e168555a1ca11c11d615ac54127eb1
parentb4668579286c56fded2816602e104abbcf0b5adb
net/ice: fix hash flow crash

Commit 'dc36bd5dfdeb' mistakenly initializes ret as -rte_errno, then
return ret if ice_search_pattern_match_item fails, if rte_errno happens
to be 0 in this case, it would cause an unrecognized flow rule to be
marked as recognition success. Later, when the code tries to parse the
flow rule, a segmentation fault will occur due to null pointer
reference.

Fixes: dc36bd5dfdeb ("net/ice: fix flow FDIR/switch memory leak")
Cc: stable@dpdk.org
Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/ice/ice_hash.c