|
@@ -486,8 +486,11 @@ int mlx4_ib_rereg_user_mr(struct ib_mr *mr, int flags,
|
|
|
}
|
|
|
|
|
|
if (flags & IB_MR_REREG_ACCESS) {
|
|
|
- if (ib_access_writable(mr_access_flags) && !mmr->umem->writable)
|
|
|
- return -EPERM;
|
|
|
+ if (ib_access_writable(mr_access_flags) &&
|
|
|
+ !mmr->umem->writable) {
|
|
|
+ err = -EPERM;
|
|
|
+ goto release_mpt_entry;
|
|
|
+ }
|
|
|
|
|
|
err = mlx4_mr_hw_change_access(dev->dev, *pmpt_entry,
|
|
|
convert_access(mr_access_flags));
|