提交 433c5813 编写于 作者: M Mustafa Ismail 提交者: 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: NStefan Assmann <sassmann@redhat.com>
Signed-off-by: NMustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: NShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: NDoug Ledford <dledford@redhat.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册