i40e: fix using memory after free
authorJiangu Zhao <zhaojg@arraynetworks.com.cn>
Fri, 25 Mar 2016 09:17:01 +0000 (09:17 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 25 Mar 2016 18:03:48 +0000 (19:03 +0100)
commitb3fa893d84d650f82cc7250d895c84dff0c7ce5b
tree1435477f3847d3304986d63049faa6858f158cb4
parent5b7bb2bda5519b7800f814df64d4e015282140e5
i40e: fix using memory after free

The code uses "entry" in the next loop of LIST_FOREACH after calling free()
on it in i40e_res_pool_destroy().
Change to a safe way to free entry, which is similar with LIST_FOREACH_SAFE
in FreeBSD.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Jiangu Zhao <zhaojg@arraynetworks.com.cn>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
drivers/net/i40e/i40e_ethdev.c