RDMA/rxe: Set pd early in mr alloc routines
authorBob Pearson <rpearsonhpe@gmail.com>
Fri, 5 Aug 2022 18:31:54 +0000 (13:31 -0500)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 27 Sep 2022 13:15:24 +0000 (10:15 -0300)
commit58651bbb30f87dab474eff31ab564391aa6ea1f3
tree9d1ce1035b99118c499cbf88de77263f7b45dd69
parentf994ae0a143485fcc02ebf17a329239430306b6c
RDMA/rxe: Set pd early in mr alloc routines

Move setting of pd in mr objects ahead of any possible errors so that it
will always be set in rxe_mr_cleanup() to avoid seg faults when
rxe_put(mr_pd(mr)) is called.

Fixes: cf40367961d8 ("RDMA/rxe: Move mr cleanup code to rxe_mr_cleanup()")
Link: https://lore.kernel.org/r/20220805183153.32007-2-rpearsonhpe@gmail.com
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
Reviewed-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/rxe/rxe_loc.h
drivers/infiniband/sw/rxe/rxe_mr.c
drivers/infiniband/sw/rxe/rxe_verbs.c