i40iw: Do not set self-referencing pointer to NULL after kfree

In i40iw_free_virt_mem(), do not set mem->va to NULL
after freeing it as mem->va is a self-referencing pointer
to mem.

Fixes: 4e9042e647 ("i40iw: add hw and utils files")

Reported-by: Stefan Assmann <sassmann@redhat.com>
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Mustafa Ismail 2016-08-22 19:01:47 -05:00 committed by Doug Ledford
parent 5dfd5e5e3b
commit 7eaf8313b1
1 changed files with 4 additions and 1 deletions

View File

@ -673,8 +673,11 @@ enum i40iw_status_code i40iw_free_virt_mem(struct i40iw_hw *hw,
{
if (!mem)
return I40IW_ERR_PARAM;
/*
* mem->va points to the parent of mem, so both mem and mem->va
* can not be touched once mem->va is freed
*/
kfree(mem->va);
mem->va = NULL;
return 0;
}