4.7-stable review patch. If anyone has any objections, please let me know.
------------------ From: Mustafa Ismail <mustafa.ism...@intel.com> commit 7eaf8313b1cfe93417a22bdc3f7380cac2a3dc6d upstream. 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: 4e9042e647ff ("i40iw: add hw and utils files") Reported-by: Stefan Assmann <sassm...@redhat.com> Signed-off-by: Mustafa Ismail <mustafa.ism...@intel.com> Signed-off-by: Shiraz Saleem <shiraz.sal...@intel.com> Signed-off-by: Doug Ledford <dledf...@redhat.com> Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> --- drivers/infiniband/hw/i40iw/i40iw_utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/infiniband/hw/i40iw/i40iw_utils.c +++ b/drivers/infiniband/hw/i40iw/i40iw_utils.c @@ -673,8 +673,11 @@ enum i40iw_status_code i40iw_free_virt_m { 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; }