IB/mlx5: Don't clean uninitialized UMR resources
authorMark Bloch <markb@mellanox.com>
Tue, 20 Mar 2018 13:45:37 +0000 (15:45 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 21 Mar 2018 20:22:22 +0000 (14:22 -0600)
commit32927e281c004c352c0b88d2975f5511e5b7cf8e
treeabfd68e23a43524f34597a6694956c1083f020a5
parente8980d67d6017c8eee8f9c35f782c4bd68e004c9
IB/mlx5: Don't clean uninitialized UMR resources

In case we failed to create UMR resources, mark them as invalid so we
won't try to destroy them on the unwind path.

Add the relevant checks to destroy_umrc_res(), this is done for the
unlikely event ib_register_device() or create_umr_res() err out and we
try to destroy invalid objects.

Fixes: 42cea83f9524 ("IB/mlx5: Fix cleanup order on unload")
Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/main.c
drivers/infiniband/hw/mlx5/mr.c