IB/mlx4: Fix an error handling path in 'mlx4_ib_rereg_user_mr()'
Before returning -EPERM we should release some resources, as already done
in the other error handling path of the function.
Fixes: d8f9cc328c
("IB/mlx4: Mark user MR as writable if actual virtual memory is writable")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
425cf5c135
commit
3dc7c7badb
@ -486,8 +486,11 @@ int mlx4_ib_rereg_user_mr(struct ib_mr *mr, int flags,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags & IB_MR_REREG_ACCESS) {
|
if (flags & IB_MR_REREG_ACCESS) {
|
||||||
if (ib_access_writable(mr_access_flags) && !mmr->umem->writable)
|
if (ib_access_writable(mr_access_flags) &&
|
||||||
return -EPERM;
|
!mmr->umem->writable) {
|
||||||
|
err = -EPERM;
|
||||||
|
goto release_mpt_entry;
|
||||||
|
}
|
||||||
|
|
||||||
err = mlx4_mr_hw_change_access(dev->dev, *pmpt_entry,
|
err = mlx4_mr_hw_change_access(dev->dev, *pmpt_entry,
|
||||||
convert_access(mr_access_flags));
|
convert_access(mr_access_flags));
|
||||||
|
Loading…
Reference in New Issue
Block a user