Skip to content

Commit 11d7480

Browse files
haggaiedledford
authored andcommitted
IB/mlx5: avoid destroying a NULL mr in reg_user_mr error flow
The mlx5_ib_reg_user_mr() function will attempt to call clean_mr() in its error flow even though there is never a case where the error flow occurs with a valid MR pointer to destroy. Remove the clean_mr() call and the incorrect comment above it. Fixes: b4cfe44 ("IB/mlx5: Implement on demand paging by adding support for MMU notifiers") Cc: Eli Cohen <eli@mellanox.com> Signed-off-by: Haggai Eran <haggaie@mellanox.com> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
1 parent b632ffa commit 11d7480

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

  • drivers/infiniband/hw/mlx5

‎drivers/infiniband/hw/mlx5/mr.c‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,19 +1114,7 @@ struct ib_mr *mlx5_ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
11141114
return &mr->ibmr;
11151115

11161116
error:
1117-
/*
1118-
* Destroy the umem *before* destroying the MR, to ensure we
1119-
* will not have any in-flight notifiers when destroying the
1120-
* MR.
1121-
*
1122-
* As the MR is completely invalid to begin with, and this
1123-
* error path is only taken if we can't push the mr entry into
1124-
* the pagefault tree, this is safe.
1125-
*/
1126-
11271117
ib_umem_release(umem);
1128-
/* Kill the MR, and return an error code. */
1129-
clean_mr(mr);
11301118
return ERR_PTR(err);
11311119
}
11321120

0 commit comments

Comments
 (0)