Commit 433c5813 authored by Mustafa Ismail's avatar Mustafa Ismail Committed by Doug Ledford

i40iw: Avoid writing to freed memory

iwpbl->iwmr points to the structure that contains iwpbl,
which is iwmr. Setting this to NULL would result in
writing to freed memory. So just free iwmr, and return.

Fixes: d3749841 ("i40iw: add files for iwarp interface")
Reported-by: default avatarStefan Assmann <sassmann@redhat.com>
Signed-off-by: default avatarMustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent d41d0910
...@@ -1925,8 +1925,7 @@ static int i40iw_dereg_mr(struct ib_mr *ib_mr) ...@@ -1925,8 +1925,7 @@ static int i40iw_dereg_mr(struct ib_mr *ib_mr)
} }
if (iwpbl->pbl_allocated) if (iwpbl->pbl_allocated)
i40iw_free_pble(iwdev->pble_rsrc, palloc); i40iw_free_pble(iwdev->pble_rsrc, palloc);
kfree(iwpbl->iwmr); kfree(iwmr);
iwpbl->iwmr = NULL;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment