]> git.baikalelectronics.ru Git - kernel.git/commit
i40e: use the safe hash table iterator when deleting mac filters
authorLihong Yang <lihong.yang@intel.com>
Thu, 7 Sep 2017 12:05:46 +0000 (08:05 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 9 Oct 2017 21:12:54 +0000 (14:12 -0700)
commitca5bba51dc5e8567fe3d3659dc1bcabe1c7ec989
tree6eb971acfadf388124e9ad3addd1a0579f358497
parent80181f257e4b51d039a66fef1cac99212c9372d0
i40e: use the safe hash table iterator when deleting mac filters

This patch replaces hash_for_each function with hash_for_each_safe
when calling  __i40e_del_filter. The hash_for_each_safe function is
the right one to use when iterating over a hash table to safely remove
a hash entry. Otherwise, incorrect values may be read from freed memory.

Detected by CoverityScan, CID 1402048 Read from pointer after free

Signed-off-by: Lihong Yang <lihong.yang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c