mirror of https://gitee.com/openkylin/linux.git
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: d374984179
("i40iw: add files for iwarp interface")
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:
parent
d41d0910d9
commit
433c58139f
|
@ -1925,8 +1925,7 @@ static int i40iw_dereg_mr(struct ib_mr *ib_mr)
|
|||
}
|
||||
if (iwpbl->pbl_allocated)
|
||||
i40iw_free_pble(iwdev->pble_rsrc, palloc);
|
||||
kfree(iwpbl->iwmr);
|
||||
iwpbl->iwmr = NULL;
|
||||
kfree(iwmr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue